From 65cf4cf7c7dde3a0a917801210ba68c7ac6fa915 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 21 Nov 2019 14:58:35 +0000 Subject: [PATCH] make flush to track-changes failsafe --- services/document-updater/app/coffee/HistoryManager.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/document-updater/app/coffee/HistoryManager.coffee b/services/document-updater/app/coffee/HistoryManager.coffee index 286292e6b3..50fd645669 100644 --- a/services/document-updater/app/coffee/HistoryManager.coffee +++ b/services/document-updater/app/coffee/HistoryManager.coffee @@ -13,8 +13,9 @@ module.exports = HistoryManager = return RedisManager.getHistoryType doc_id, (err, projectHistoryType) -> if err? - logger.error {err, doc_id}, "error getting history type" - else if projectHistoryType is "project-history" + logger.warn {err, doc_id}, "error getting history type" + # if there's an error continue and flush to track-changes for safety + if projectHistoryType is "project-history" logger.debug {doc_id, projectHistoryType}, "skipping track-changes flush" else url = "#{Settings.apis.trackchanges.url}/project/#{project_id}/doc/#{doc_id}/flush"