mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-23 13:31:21 +00:00
invalidate the cache if there is an error copying a file
This commit is contained in:
parent
56b77c300c
commit
72918fb41b
1 changed files with 6 additions and 1 deletions
|
@ -10,7 +10,12 @@ module.exports = UrlCache =
|
|||
downloadUrlToFile: (project_id, url, destPath, lastModified, callback = (error) ->) ->
|
||||
UrlCache._ensureUrlIsInCache project_id, url, lastModified, (error, pathToCachedUrl) =>
|
||||
return callback(error) if error?
|
||||
UrlCache._copyFile(pathToCachedUrl, destPath, callback)
|
||||
UrlCache._copyFile pathToCachedUrl, destPath, (error) ->
|
||||
if error?
|
||||
UrlCache._clearUrlDetails project_id, url, () ->
|
||||
callback(error)
|
||||
else
|
||||
callback(error)
|
||||
|
||||
clearProject: (project_id, callback = (error) ->) ->
|
||||
UrlCache._findAllUrlsInProject project_id, (error, urls) ->
|
||||
|
|
Loading…
Reference in a new issue