mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
use background flush on disconnect
This commit is contained in:
parent
8e28e33b05
commit
63f052192e
1 changed files with 3 additions and 1 deletions
|
@ -36,9 +36,11 @@ module.exports = DocumentUpdaterManager =
|
|||
callback err
|
||||
|
||||
flushProjectToMongoAndDelete: (project_id, callback = ()->) ->
|
||||
# this method is called when the last connected user leaves the project
|
||||
logger.log project_id:project_id, "deleting project from document updater"
|
||||
timer = new metrics.Timer("delete.mongo.project")
|
||||
url = "#{settings.apis.documentupdater.url}/project/#{project_id}"
|
||||
# flush the project in the background when all users have left
|
||||
url = "#{settings.apis.documentupdater.url}/project/#{project_id}?background=true"
|
||||
request.del url, (err, res, body)->
|
||||
timer.done()
|
||||
if err?
|
||||
|
|
Loading…
Reference in a new issue