stop OpRangeNotAvailable errors going to sentry

This commit is contained in:
Brian Gough 2018-04-27 15:45:28 +01:00
parent 2ce19b13e3
commit 64670f272a

View file

@ -2,6 +2,7 @@ Settings = require('settings-sharelatex')
logger = require('logger-sharelatex')
Keys = require('./UpdateKeys')
redis = require("redis-sharelatex")
Errors = require("./Errors")
UpdateManager = require('./UpdateManager')
Metrics = require('./Metrics')
@ -23,7 +24,9 @@ module.exports = DispatchManager =
# Dispatch this in the background
backgroundTask = (cb) ->
UpdateManager.processOutstandingUpdatesWithLock project_id, doc_id, (error) ->
logger.error err: error, project_id: project_id, doc_id: doc_id, "error processing update" if error?
# log everything except OpRangeNotAvailable errors, these are normal
if error? and not (error instanceof Errors.OpRangeNotAvailableError)
logger.error err: error, project_id: project_id, doc_id: doc_id, "error processing update"
cb()
RateLimiter.run backgroundTask, callback