mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
Merge pull request #16 from sharelatex/bg-handle-ops-after-delete
allow flush to succeed when doc is already deleted
This commit is contained in:
commit
85de4f2bc5
1 changed files with 7 additions and 2 deletions
|
@ -20,10 +20,15 @@ module.exports = ProjectManager =
|
||||||
do (doc_id) ->
|
do (doc_id) ->
|
||||||
jobs.push (callback) ->
|
jobs.push (callback) ->
|
||||||
DocumentManager.flushDocIfLoadedWithLock project_id, doc_id, (error) ->
|
DocumentManager.flushDocIfLoadedWithLock project_id, doc_id, (error) ->
|
||||||
if error?
|
if error? and error instanceof Errors.NotFoundError
|
||||||
|
logger.warn err: error, project_id: project_id, doc_id: doc_id, "found deleted doc when flushing"
|
||||||
|
callback()
|
||||||
|
else if error?
|
||||||
logger.error err: error, project_id: project_id, doc_id: doc_id, "error flushing doc"
|
logger.error err: error, project_id: project_id, doc_id: doc_id, "error flushing doc"
|
||||||
errors.push(error)
|
errors.push(error)
|
||||||
callback()
|
callback()
|
||||||
|
else
|
||||||
|
callback()
|
||||||
|
|
||||||
logger.log project_id: project_id, doc_ids: doc_ids, "flushing docs"
|
logger.log project_id: project_id, doc_ids: doc_ids, "flushing docs"
|
||||||
async.series jobs, () ->
|
async.series jobs, () ->
|
||||||
|
|
Loading…
Reference in a new issue