mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-05 02:46:55 +00:00
added some missing error handling
This commit is contained in:
parent
17b0d99a65
commit
18d817ee0a
1 changed files with 7 additions and 2 deletions
|
@ -26,12 +26,15 @@ module.exports = DocArchiveManager =
|
|||
|
||||
archiveDocChanges: (project_id, doc_id, callback)->
|
||||
MongoManager.getDocChangesCount doc_id, (error, count) ->
|
||||
return callback(error) if error?
|
||||
if count == 0
|
||||
return callback()
|
||||
else
|
||||
MongoManager.getLastCompressedUpdate doc_id, (error, update) ->
|
||||
return callback(error) if error?
|
||||
MongoAWS.archiveDocHistory project_id, doc_id, (error) ->
|
||||
logger.log doc_id:doc_id, error: error, "export to S3"
|
||||
return callback(error) if error?
|
||||
logger.log doc_id:doc_id, project_id:project_id, "exported document to S3"
|
||||
MongoManager.markDocHistoryAsArchived doc_id, update, (error) ->
|
||||
return callback(error) if error?
|
||||
callback()
|
||||
|
@ -48,11 +51,13 @@ module.exports = DocArchiveManager =
|
|||
|
||||
unArchiveDocChanges: (project_id, doc_id, callback)->
|
||||
MongoManager.getArchivedDocChanges doc_id, (error, count) ->
|
||||
return callback(error) if error?
|
||||
if count == 0
|
||||
return callback()
|
||||
else
|
||||
MongoAWS.unArchiveDocHistory project_id, doc_id, (error) ->
|
||||
logger.log doc_id:doc_id, error: error, "import from S3"
|
||||
return callback(error) if error?
|
||||
logger.log doc_id:doc_id, project_id:project_id, "imported document from S3"
|
||||
MongoManager.markDocHistoryAsUnarchived doc_id, (error) ->
|
||||
return callback(error) if error?
|
||||
callback()
|
||||
|
|
Loading…
Reference in a new issue