mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 05:11:34 +02:00
skip history flush when project is cleared by realtime shutdown
history is flushed by a background cron job anyway
This commit is contained in:
@@ -28,6 +28,9 @@ module.exports = HistoryManager =
|
||||
# flush changes and callback (for when we need to know the queue is flushed)
|
||||
flushProjectChanges: (project_id, options, callback = (error) ->) ->
|
||||
return callback() if !Settings.apis?.project_history?.enabled
|
||||
if options.skip_history_flush
|
||||
logger.log {project_id}, "skipping flush of project history from realtime shutdown"
|
||||
return callback()
|
||||
url = "#{Settings.apis.project_history.url}/project/#{project_id}/flush"
|
||||
qs = {}
|
||||
qs.background = true if options.background # pass on the background flush option if present
|
||||
|
||||
@@ -133,6 +133,7 @@ module.exports = HttpController =
|
||||
timer = new Metrics.Timer("http.deleteProject")
|
||||
options = {}
|
||||
options.background = true if req.query?.background # allow non-urgent flushes to be queued
|
||||
options.skip_history_flush = true if req.query?.shutdown # don't flush history when realtime shuts down
|
||||
ProjectManager.flushAndDeleteProjectWithLocks project_id, options, (error) ->
|
||||
timer.done()
|
||||
return next(error) if error?
|
||||
|
||||
Reference in New Issue
Block a user