mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 10:03:43 -05:00
keep flushQueuedProjects in the foreground
This commit is contained in:
parent
7561e05660
commit
260923f291
1 changed files with 4 additions and 3 deletions
|
@ -216,14 +216,15 @@ module.exports = HttpController =
|
||||||
res.send project_ids
|
res.send project_ids
|
||||||
|
|
||||||
flushQueuedProjects: (req, res, next = (error) ->) ->
|
flushQueuedProjects: (req, res, next = (error) ->) ->
|
||||||
|
res.setTimeout(10 * 60 * 1000)
|
||||||
options =
|
options =
|
||||||
limit : req.query.limit || 1000
|
limit : req.query.limit || 1000
|
||||||
timeout: 5 * 60 * 1000
|
timeout: 5 * 60 * 1000
|
||||||
min_delete_age: req.query.min_delete_age || 5 * 60 * 1000
|
min_delete_age: req.query.min_delete_age || 5 * 60 * 1000
|
||||||
res.send 204
|
|
||||||
# run the flush in the background
|
|
||||||
DeleteQueueManager.flushAndDeleteOldProjects options, (err, flushed)->
|
DeleteQueueManager.flushAndDeleteOldProjects options, (err, flushed)->
|
||||||
if err?
|
if err?
|
||||||
logger.err err:err, "error flushing old projects"
|
logger.err err:err, "error flushing old projects"
|
||||||
else
|
res.send 500
|
||||||
|
else
|
||||||
logger.log {flushed: flushed}, "flush of queued projects completed"
|
logger.log {flushed: flushed}, "flush of queued projects completed"
|
||||||
|
res.send {flushed: flushed}
|
||||||
|
|
Loading…
Reference in a new issue