1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-08 23:25:51 +01:00

caching tarballs

This commit is contained in:
Alex Kocharin 2013-06-20 20:54:50 +04:00
parent dfd0459c03
commit b4688d140f

@ -113,15 +113,22 @@ Storage.prototype.get_tarball = function(name, filename, callback) {
}, 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);
rstream2.on('error', function(err) {
stream.emit('error', err);
});
rstream2.on('data', function(data) {
stream.write(data);
savestream.write(data);
});
rstream2.on('end', function() {
stream.end();
savestream.end();
});
});
});