share the document lock between archiving and packing

This commit is contained in:
Brian Gough 2015-09-16 16:03:55 +01:00
parent 9d39012b49
commit b4ffa7d57e

View file

@ -22,7 +22,7 @@ module.exports = DocArchiveManager =
archiveDocChangesWithLock: (project_id, doc_id, callback = (error) ->) ->
job = (releaseLock) ->
DocArchiveManager.archiveDocChanges project_id, doc_id, releaseLock
LockManager.runWithLock("HistoryArchiveLock:#{doc_id}", job, callback)
LockManager.runWithLock("HistoryLock:#{doc_id}", job, callback)
archiveDocChanges: (project_id, doc_id, callback)->
MongoManager.getDocChangesCount doc_id, (error, count) ->