Explorar o código

make flush to track-changes failsafe

Brian Gough %!s(int64=7) %!d(string=hai) anos
pai
achega
65cf4cf7c7
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      services/document-updater/app/coffee/HistoryManager.coffee

+ 3 - 2
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"