clean up stream handling for file copy

This commit is contained in:
Brian Gough 2015-05-15 14:17:40 +01:00
parent 56f1ffa067
commit aa32cbc1ee

View file

@ -75,7 +75,8 @@ module.exports = UrlCache =
readStream = fs.createReadStream(from)
writeStream.on "error", callbackOnce
readStream.on "error", callbackOnce
writeStream.on "close", () -> callbackOnce()
writeStream.on "close", callbackOnce
writeStream.on "open", () ->
readStream.pipe(writeStream)
_clearUrlFromCache: (project_id, url, callback = (error) ->) ->