From a0aa6b9cc7d75ebab7969bd84a0cd4e99977625e Mon Sep 17 00:00:00 2001 From: Andrew Rumble Date: Fri, 25 Apr 2025 12:13:50 +0100 Subject: [PATCH] Use correct identifier for updating history id GitOrigin-RevId: d95c6e85a8fd530189c14e36fed1112a51fb8609 --- .../flush_projects_with_no_history_id.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/services/document-updater/scripts/flush_projects_with_no_history_id.js b/services/document-updater/scripts/flush_projects_with_no_history_id.js index cf3440725d..18c1644e4b 100644 --- a/services/document-updater/scripts/flush_projects_with_no_history_id.js +++ b/services/document-updater/scripts/flush_projects_with_no_history_id.js @@ -122,13 +122,18 @@ async function fixAndFlushProjects(updates) { for (const update of updates) { logger.debug({ ...update }, 'Flushing project') if (commit) { - await rclient.set( - docUpdaterKeys.projectHistoryId({ doc_id: '*' }), - update.historyId - ) - await ProjectManager.promises.flushAndDeleteProjectWithLocks( - update.projectId, - {} + try { + await rclient.set( + docUpdaterKeys.projectHistoryId({ doc_id: update.docId }), + update.historyId + ) + await ProjectManager.promises.flushAndDeleteProjectWithLocks( + update.projectId, + {} + ) + } catch (err) { + logger.error({ err, ...update }, 'Error fixing and flushing project') + } ) } }