make event order check a configuration setting

This commit is contained in:
Brian Gough 2019-07-15 13:45:34 +01:00
parent a724021900
commit 8a7804f0a7
3 changed files with 4 additions and 2 deletions

View file

@ -34,7 +34,7 @@ module.exports = DocumentUpdaterController =
logger.error {err: error, channel}, "error parsing JSON" logger.error {err: error, channel}, "error parsing JSON"
return return
if message.op? if message.op?
if message._id? if message._id? && settings.checkEventOrder
status = EventLogger.checkEventOrder("applied-ops", message._id, message) status = EventLogger.checkEventOrder("applied-ops", message._id, message)
if status is 'duplicate' if status is 'duplicate'
return # skip duplicate events return # skip duplicate events

View file

@ -41,7 +41,7 @@ module.exports = WebsocketLoadBalancer =
if message.room_id == "all" if message.room_id == "all"
io.sockets.emit(message.message, message.payload...) io.sockets.emit(message.message, message.payload...)
else if message.room_id? else if message.room_id?
if message._id? if message._id? && Settings.checkEventOrder
status = EventLogger.checkEventOrder("editor-events", message._id, message) status = EventLogger.checkEventOrder("editor-events", message._id, message)
if status is "duplicate" if status is "duplicate"
return # skip duplicate events return # skip duplicate events

View file

@ -52,6 +52,8 @@ settings =
continualPubsubTraffic: process.env['CONTINUAL_PUBSUB_TRAFFIC'] or false continualPubsubTraffic: process.env['CONTINUAL_PUBSUB_TRAFFIC'] or false
checkEventOrder: process.env['CHECK_EVENT_ORDER'] or false
sentry: sentry:
dsn: process.env.SENTRY_DSN dsn: process.env.SENTRY_DSN