Merge pull request #9335 from overleaf/bg-queue-polling

combine dropbox polls and updates into one queue

GitOrigin-RevId: b966f706af9000ce80977b78cd84207a22db25a2
This commit is contained in:
Brian Gough 2022-09-01 10:33:08 +01:00 committed by Copybot
parent 9e8d10bd8e
commit af3629687b
2 changed files with 4 additions and 2 deletions

View file

@ -253,7 +253,9 @@ async function pollDropboxForUser(userId) {
},
}
return enqueue(`poll-dropbox:${userId}`, 'standardHttpRequest', job)
// Queue poll requests in the user queue along with file updates, in order
// to avoid race conditions between polling and updates.
return enqueue(userId, 'standardHttpRequest', job)
}
const TpdsUpdateSender = {

View file

@ -347,7 +347,7 @@ describe('TpdsUpdateSender', function () {
method: method0,
} = this.request.firstCall.args[0].json
group0.should.equal(`poll-dropbox:${userId}`)
group0.should.equal(userId)
method0.should.equal('standardHttpRequest')
job0.method.should.equal('post')