mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
[history-ot] flush history for projects with short queues ASAP (#25776)
* [document-updater] flush history for projects with short queues ASAP * [k8s] document-updater: enable short history queue for history-ot demo * [project-history] flush history for projects with short queues ASAP * [project-history] wait for mongo before running acceptance tests * [k8s] project-history: enable short history queue for history-ot demo * [project-history] change wait-for-mongo step in tests Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com> --------- Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com> GitOrigin-RevId: 3e989c409e8e9887655b35f2659ce0829e61b357
This commit is contained in:
committed by
Copybot
co-authored by
Eric Mc Sween
parent
2f87db9c0d
commit
64984ee86a
@@ -11,6 +11,7 @@ import async from 'async'
|
||||
import logger from '@overleaf/logger'
|
||||
import OError from '@overleaf/o-error'
|
||||
import metrics from '@overleaf/metrics'
|
||||
import Settings from '@overleaf/settings'
|
||||
import _ from 'lodash'
|
||||
import * as RedisManager from './RedisManager.js'
|
||||
import * as UpdatesProcessor from './UpdatesProcessor.js'
|
||||
@@ -37,6 +38,13 @@ export function flushIfOld(projectId, cutoffTime, callback) {
|
||||
)
|
||||
metrics.inc('flush-old-updates', 1, { status: 'flushed' })
|
||||
return UpdatesProcessor.processUpdatesForProject(projectId, callback)
|
||||
} else if (Settings.shortHistoryQueues.includes(projectId)) {
|
||||
logger.debug(
|
||||
{ projectId, firstOpTimestamp, cutoffTime },
|
||||
'flushing project with short queue'
|
||||
)
|
||||
metrics.inc('flush-old-updates', 1, { status: 'short-queue' })
|
||||
return UpdatesProcessor.processUpdatesForProject(projectId, callback)
|
||||
} else {
|
||||
metrics.inc('flush-old-updates', 1, { status: 'skipped' })
|
||||
return callback()
|
||||
|
||||
Reference in New Issue
Block a user