Просмотр исходного кода

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

combine dropbox polls and updates into one queue

GitOrigin-RevId: b966f706af9000ce80977b78cd84207a22db25a2
Brian Gough 4 лет назад
Родитель
Сommit
af3629687b

+ 3 - 1
services/web/app/src/Features/ThirdPartyDataStore/TpdsUpdateSender.js

@@ -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 = {

+ 1 - 1
services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateSenderTests.js

@@ -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')