mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-11 07:00:47 +02:00
Delay Dropbox polling by 5 seconds and dispatch only a single request
This commit is contained in:
@@ -10,6 +10,10 @@ module.exports = DropboxWebhookController =
|
||||
logger.log dropbox_uids: dropbox_uids, "received webhook request from Dropbox"
|
||||
if !dropbox_uids?
|
||||
return res.send(400) # Bad Request
|
||||
|
||||
# Do this in the background so as not to keep Dropbox waiting
|
||||
DropboxWebhookHandler.pollDropboxUids dropbox_uids, (error) ->
|
||||
return next(error) if error?
|
||||
res.send(200)
|
||||
if error?
|
||||
logger.error err: error, dropbox_uids: dropbox_uids, "error in webhook"
|
||||
|
||||
res.send(200)
|
||||
Reference in New Issue
Block a user