Merge pull request #8839 from overleaf/bg-disable-track-changes

[document-updater]  disable track-changes

GitOrigin-RevId: f97be24d959ec8fd21e39c46a13b124ed9e5b406
This commit is contained in:
Brian Gough 2022-08-05 09:19:12 +01:00 committed by Copybot
parent 6d89ab0377
commit 678148d1b9
3 changed files with 14 additions and 6 deletions

View file

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

View file

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

View file

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