From 501be348626730eb6005ca86776940ddf6b5a797 Mon Sep 17 00:00:00 2001 From: Eric Mc Sween <5454374+emcsween@users.noreply.github.com> Date: Mon, 29 Apr 2024 11:30:51 -0400 Subject: [PATCH] Merge pull request #18156 from overleaf/em-fix-queue-size-metric Fix queue size by error metric in project history dashboard GitOrigin-RevId: e837c6fc00acd23671f017c70cd9b2c643c02482 --- services/project-history/app/js/UpdatesProcessor.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/project-history/app/js/UpdatesProcessor.js b/services/project-history/app/js/UpdatesProcessor.js index eb8a051ed1..e636924fb0 100644 --- a/services/project-history/app/js/UpdatesProcessor.js +++ b/services/project-history/app/js/UpdatesProcessor.js @@ -170,10 +170,11 @@ _mocks._countAndProcessUpdates = ( _processUpdatesBatch(projectId, updates, extendLock, cb) }, error => { - if (error) { - return callback(error) - } - callback(null, queueSize) + // Unconventional callback signature. The caller needs the queue size + // even when an error is thrown in order to record the queue size in + // the projectHistoryFailures collection. We'll have to find another + // way to achieve this when we promisify. + callback(error, queueSize) } ) } else {