mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #21751 from overleaf/bg-record-background-flush-operations
record background flush operations in project-history GitOrigin-RevId: 80169b3f93a844d7162322ca21d605fffc64d687
This commit is contained in:
parent
2939282a7f
commit
fc84bdf68b
1 changed files with 3 additions and 0 deletions
|
@ -10,6 +10,7 @@
|
||||||
import async from 'async'
|
import async from 'async'
|
||||||
import logger from '@overleaf/logger'
|
import logger from '@overleaf/logger'
|
||||||
import OError from '@overleaf/o-error'
|
import OError from '@overleaf/o-error'
|
||||||
|
import metrics from '@overleaf/metrics'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import * as RedisManager from './RedisManager.js'
|
import * as RedisManager from './RedisManager.js'
|
||||||
import * as UpdatesProcessor from './UpdatesProcessor.js'
|
import * as UpdatesProcessor from './UpdatesProcessor.js'
|
||||||
|
@ -34,8 +35,10 @@ export function flushIfOld(projectId, cutoffTime, callback) {
|
||||||
{ projectId, firstOpTimestamp, cutoffTime },
|
{ projectId, firstOpTimestamp, cutoffTime },
|
||||||
'flushing old project'
|
'flushing old project'
|
||||||
)
|
)
|
||||||
|
metrics.inc('flush-old-updates', 1, { status: 'flushed' })
|
||||||
return UpdatesProcessor.processUpdatesForProject(projectId, callback)
|
return UpdatesProcessor.processUpdatesForProject(projectId, callback)
|
||||||
} else {
|
} else {
|
||||||
|
metrics.inc('flush-old-updates', 1, { status: 'skipped' })
|
||||||
return callback()
|
return callback()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue