mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
caching tarballs
This commit is contained in:
parent
dfd0459c03
commit
b4688d140f
1 changed files with 7 additions and 0 deletions
|
@ -113,15 +113,22 @@ Storage.prototype.get_tarball = function(name, filename, callback) {
|
||||||
}, self.config);
|
}, self.config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var savestream = self.local.add_tarball(name, filename);
|
||||||
|
savestream.on('error', function(err) {
|
||||||
|
stream.emit('error', err);
|
||||||
|
});
|
||||||
|
|
||||||
var rstream2 = uplink.get_url(file.url);
|
var rstream2 = uplink.get_url(file.url);
|
||||||
rstream2.on('error', function(err) {
|
rstream2.on('error', function(err) {
|
||||||
stream.emit('error', err);
|
stream.emit('error', err);
|
||||||
});
|
});
|
||||||
rstream2.on('data', function(data) {
|
rstream2.on('data', function(data) {
|
||||||
stream.write(data);
|
stream.write(data);
|
||||||
|
savestream.write(data);
|
||||||
});
|
});
|
||||||
rstream2.on('end', function() {
|
rstream2.on('end', function() {
|
||||||
stream.end();
|
stream.end();
|
||||||
|
savestream.end();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue