mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 16:03:37 -05:00
don't log errors when files have disappeared from build directory
This commit is contained in:
parent
4a785ff43c
commit
27b739b081
1 changed files with 10 additions and 4 deletions
|
@ -125,8 +125,11 @@ module.exports = OutputCacheManager =
|
||||||
_checkFileIsSafe: (src, callback = (error, isSafe) ->) ->
|
_checkFileIsSafe: (src, callback = (error, isSafe) ->) ->
|
||||||
# check if we have a valid file to copy into the cache
|
# check if we have a valid file to copy into the cache
|
||||||
fs.stat src, (err, stats) ->
|
fs.stat src, (err, stats) ->
|
||||||
if err?
|
if err?.code is 'ENOENT'
|
||||||
# some problem reading the file
|
logger.warn err: err, file: src, "file has disappeared before copying to build cache"
|
||||||
|
callback(err, false)
|
||||||
|
else if err?
|
||||||
|
# some other problem reading the file
|
||||||
logger.error err: err, file: src, "stat error for file in cache"
|
logger.error err: err, file: src, "stat error for file in cache"
|
||||||
callback(err, false)
|
callback(err, false)
|
||||||
else if not stats.isFile()
|
else if not stats.isFile()
|
||||||
|
@ -140,7 +143,10 @@ module.exports = OutputCacheManager =
|
||||||
_copyFile: (src, dst, callback) ->
|
_copyFile: (src, dst, callback) ->
|
||||||
# copy output file into the cache
|
# copy output file into the cache
|
||||||
fse.copy src, dst, (err) ->
|
fse.copy src, dst, (err) ->
|
||||||
if err?
|
if err?.code is 'ENOENT'
|
||||||
|
logger.warn err: err, file: src, "file has disappeared when copying to build cache"
|
||||||
|
callback(err, false)
|
||||||
|
else if err?
|
||||||
logger.error err: err, src: src, dst: dst, "copy error for file in cache"
|
logger.error err: err, src: src, dst: dst, "copy error for file in cache"
|
||||||
callback(err)
|
callback(err)
|
||||||
else
|
else
|
||||||
|
@ -155,4 +161,4 @@ module.exports = OutputCacheManager =
|
||||||
return callback(null, true)
|
return callback(null, true)
|
||||||
if Settings.clsi?.archive_logs and Path.basename(src) in ["output.log", "output.blg"]
|
if Settings.clsi?.archive_logs and Path.basename(src) in ["output.log", "output.blg"]
|
||||||
return callback(null, true)
|
return callback(null, true)
|
||||||
return callback(null, false)
|
return callback(null, false)
|
||||||
|
|
Loading…
Reference in a new issue