rework the archiveDocChangesWithLock function

make it a bit more readable for me, struggle to trust indentation
based calls in coffeescript
This commit is contained in:
Henry Oswald
2015-09-08 16:26:01 +01:00
parent 0b3ebcff06
commit 17b0d99a65
@@ -20,12 +20,9 @@ module.exports = DocArchiveManager =
async.series jobs, callback
archiveDocChangesWithLock: (project_id, doc_id, callback = (error) ->) ->
LockManager.runWithLock(
"HistoryArchiveLock:#{doc_id}",
(releaseLock) ->
DocArchiveManager.archiveDocChanges project_id, doc_id, releaseLock
callback
)
job = (releaseLock) ->
DocArchiveManager.archiveDocChanges project_id, doc_id, releaseLock
LockManager.runWithLock("HistoryArchiveLock:#{doc_id}", job, callback)
archiveDocChanges: (project_id, doc_id, callback)->
MongoManager.getDocChangesCount doc_id, (error, count) ->