diff --git a/services/document-updater/app/coffee/HistoryManager.coffee b/services/document-updater/app/coffee/HistoryManager.coffee index 0c3ab9cea1..7cfafa9ba0 100644 --- a/services/document-updater/app/coffee/HistoryManager.coffee +++ b/services/document-updater/app/coffee/HistoryManager.coffee @@ -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 diff --git a/services/document-updater/app/coffee/HttpController.coffee b/services/document-updater/app/coffee/HttpController.coffee index b35943f5cd..d2ef5043d0 100644 --- a/services/document-updater/app/coffee/HttpController.coffee +++ b/services/document-updater/app/coffee/HttpController.coffee @@ -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?