mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-24 17:43:40 +00:00
limit parallel resync doc requests to web
This commit is contained in:
parent
e471730efb
commit
aa013f0bee
1 changed files with 3 additions and 1 deletions
|
@ -65,10 +65,12 @@ module.exports = HistoryManager =
|
|||
newBlock = Math.floor(length / threshold)
|
||||
return newBlock != prevBlock
|
||||
|
||||
MAX_PARALLEL_REQUESTS: 4
|
||||
|
||||
resyncProjectHistory: (project_id, projectHistoryId, docs, files, callback) ->
|
||||
ProjectHistoryRedisManager.queueResyncProjectStructure project_id, projectHistoryId, docs, files, (error) ->
|
||||
return callback(error) if error?
|
||||
DocumentManager = require "./DocumentManager"
|
||||
resyncDoc = (doc, cb) ->
|
||||
DocumentManager.resyncDocContentsWithLock project_id, doc.doc, cb
|
||||
async.each docs, resyncDoc, callback
|
||||
async.eachLimit docs, HistoryManager.MAX_PARALLEL_REQUESTS, resyncDoc, callback
|
||||
|
|
Loading…
Reference in a new issue