diff --git a/services/document-updater/app/js/HistoryManager.js b/services/document-updater/app/js/HistoryManager.js index ba555a02f9..3950afeca6 100644 --- a/services/document-updater/app/js/HistoryManager.js +++ b/services/document-updater/app/js/HistoryManager.js @@ -162,7 +162,7 @@ module.exports = HistoryManager = { // if the doc_ops_length is undefined it means the project is not using track-changes // so we can bail out here - if (typeof doc_ops_length === 'undefined') { + if (Settings.disableTrackChanges || typeof doc_ops_length === 'undefined') { logger.debug( { project_id, doc_id }, 'skipping flush to track-changes, only using project-history' diff --git a/services/document-updater/app/js/RedisManager.js b/services/document-updater/app/js/RedisManager.js index b14af20fb0..d00a47f270 100644 --- a/services/document-updater/app/js/RedisManager.js +++ b/services/document-updater/app/js/RedisManager.js @@ -489,7 +489,10 @@ module.exports = RedisManager = { keys.docOps({ doc_id: docId }), RedisManager.DOC_OPS_TTL ) // index 6 - if (projectHistoryType === 'project-history') { + if ( + Settings.disableTrackChanges || + projectHistoryType === 'project-history' + ) { metrics.inc('history-queue', 1, { status: 'skip-track-changes' }) logger.debug( { docId }, @@ -514,7 +517,10 @@ module.exports = RedisManager = { } let docUpdateCount - if (projectHistoryType === 'project-history') { + if ( + Settings.disableTrackChanges || + projectHistoryType === 'project-history' + ) { docUpdateCount = undefined // only using project history, don't bother with track-changes } else { // project is using old track-changes history service diff --git a/services/document-updater/config/settings.defaults.js b/services/document-updater/config/settings.defaults.js index 928f2a69e7..aef2565a56 100755 --- a/services/document-updater/config/settings.defaults.js +++ b/services/document-updater/config/settings.defaults.js @@ -180,11 +180,13 @@ module.exports = { }, publishOnIndividualChannels: - process.env.PUBLISH_ON_INDIVIDUAL_CHANNELS || false, + process.env.PUBLISH_ON_INDIVIDUAL_CHANNELS === 'true', - continuousBackgroundFlush: process.env.CONTINUOUS_BACKGROUND_FLUSH || false, + continuousBackgroundFlush: process.env.CONTINUOUS_BACKGROUND_FLUSH === 'true', smoothingOffset: process.env.SMOOTHING_OFFSET || 1000, // milliseconds - disableDoubleFlush: process.env.DISABLE_DOUBLE_FLUSH || false, // don't flush track-changes for projects using project-history + disableDoubleFlush: process.env.DISABLE_DOUBLE_FLUSH === 'true', // don't flush track-changes for projects using project-history + + disableTrackChanges: process.env.DISABLE_TRACK_CHANGES === 'true', // stop sending any updates to track-changes }