mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
[project-history] make logging of latency in resync script optional (#23325)
GitOrigin-RevId: ee6863e05be648757ccaa96a0321085fe42f508f
This commit is contained in:
@@ -36,8 +36,9 @@ const FILESTORE_SOFT_DELETE_START = new Date('2024-12-19T00:00:00Z')
|
||||
const FILESTORE_READ_OFF = new Date('2025-01-24T15:00:00Z')
|
||||
|
||||
const argv = minimist(process.argv.slice(2), {
|
||||
string: ['logs'],
|
||||
string: ['logs', 'log-latency'],
|
||||
})
|
||||
const LOG_LATENCY = argv['log-latency'] === 'true'
|
||||
|
||||
let gracefulShutdownInitiated = false
|
||||
|
||||
@@ -188,7 +189,9 @@ async function processProject(projectId, historyId) {
|
||||
try {
|
||||
await tryProcessProject(projectId, historyId)
|
||||
const latency = performance.now() - t0
|
||||
logger.info({ projectId, historyId, latency }, 'processed project')
|
||||
if (LOG_LATENCY) {
|
||||
logger.info({ projectId, historyId, latency }, 'processed project')
|
||||
}
|
||||
STATS.success++
|
||||
} catch (err) {
|
||||
logger.err({ err, projectId, historyId }, 'failed to process project')
|
||||
|
||||
Reference in New Issue
Block a user