end() is the official way to release a Writable stream

This commit is contained in:
Andy Chou 2018-01-16 12:01:33 -08:00
parent f299473697
commit b867c3299b

View File

@ -75,7 +75,7 @@ function downloadFile(file, url, callback, redirects) {
});
response.pipe(stream);
stream.on('finish', function() {
stream.close();
stream.end();
if (!completed) {
completed = true;
callback();