mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
proposed fix to delete tpds dump files after use
This commit is contained in:
parent
2ed934120c
commit
396644d314
1 changed files with 6 additions and 1 deletions
|
@ -19,11 +19,16 @@ module.exports =
|
||||||
if element?
|
if element?
|
||||||
elementId = element._id
|
elementId = element._id
|
||||||
self.p.writeStreamToDisk project_id, elementId, updateRequest, (err, fsPath)->
|
self.p.writeStreamToDisk project_id, elementId, updateRequest, (err, fsPath)->
|
||||||
|
callback = _.wrap callback, (cb, arg) ->
|
||||||
|
fs.unlink fsPath, (err) ->
|
||||||
|
if err?
|
||||||
|
logger.err project_id:project_id, fsPath:fsPath, "error deleting file"
|
||||||
|
cb(arg)
|
||||||
return callback(err) if err?
|
return callback(err) if err?
|
||||||
FileTypeManager.isBinary path, fsPath, (err, isFile)->
|
FileTypeManager.isBinary path, fsPath, (err, isFile)->
|
||||||
return callback(err) if err?
|
return callback(err) if err?
|
||||||
if isFile
|
if isFile
|
||||||
self.p.processFile project_id, elementId, fsPath, path, source, callback #TODO clean up the stream written to disk here
|
self.p.processFile project_id, elementId, fsPath, path, source, callback
|
||||||
else
|
else
|
||||||
self.p.processDoc project_id, elementId, fsPath, path, source, callback
|
self.p.processDoc project_id, elementId, fsPath, path, source, callback
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue