mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-30 11:01:37 +00:00
suppress error when removing nonexistent file from cache
This commit is contained in:
parent
2f15adaf47
commit
c1cb0f8800
1 changed files with 5 additions and 1 deletions
|
@ -87,7 +87,11 @@ module.exports = UrlCache =
|
|||
callback null
|
||||
|
||||
_deleteUrlCacheFromDisk: (project_id, url, callback = (error) ->) ->
|
||||
fs.unlink UrlCache._cacheFilePathForUrl(project_id, url), callback
|
||||
fs.unlink UrlCache._cacheFilePathForUrl(project_id, url), (error) ->
|
||||
if error? and error.code != 'ENOENT' # no error if the file isn't present
|
||||
return callback(error)
|
||||
else
|
||||
return callback()
|
||||
|
||||
_findUrlDetails: (project_id, url, callback = (error, urlDetails) ->) ->
|
||||
db.UrlCache.find(where: { url: url, project_id: project_id })
|
||||
|
|
Loading…
Reference in a new issue