mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
[FSPersistorManager] fix the stream opening for node10+
Attaching a `readable` listener causes the stream to hang otherwise. Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
This commit is contained in:
parent
330ba41dd6
commit
c5e1584fcc
1 changed files with 4 additions and 4 deletions
|
@ -48,10 +48,10 @@ module.exports =
|
||||||
fs.open "#{location}/#{filteredName}", 'r', (err, fd) ->
|
fs.open "#{location}/#{filteredName}", 'r', (err, fd) ->
|
||||||
if err?
|
if err?
|
||||||
logger.err err:err, location:location, filteredName:name, "Error reading from file"
|
logger.err err:err, location:location, filteredName:name, "Error reading from file"
|
||||||
if err.code == 'ENOENT'
|
if err.code == 'ENOENT'
|
||||||
return callback new Errors.NotFoundError(err.message), null
|
return callback new Errors.NotFoundError(err.message), null
|
||||||
else
|
else
|
||||||
return callback err, null
|
return callback err, null
|
||||||
opts.fd = fd
|
opts.fd = fd
|
||||||
sourceStream = fs.createReadStream null, opts
|
sourceStream = fs.createReadStream null, opts
|
||||||
return callback null, sourceStream
|
return callback null, sourceStream
|
||||||
|
|
Loading…
Reference in a new issue