make flush to track-changes failsafe

This commit is contained in:
Brian Gough 2019-11-21 14:58:35 +00:00
parent dcd7649bad
commit 65cf4cf7c7

View file

@ -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"