From 0a92ce18ec6237d64f1a0c30e97dc28e0546eae4 Mon Sep 17 00:00:00 2001 From: Kaspar Emanuel Date: Sat, 13 Apr 2024 13:55:20 +0100 Subject: [PATCH] processor: fix issue with continuing on error during sync (#644) --- processor/src/queues.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/processor/src/queues.ts b/processor/src/queues.ts index 2125c1b2b3..e69d2c0312 100644 --- a/processor/src/queues.ts +++ b/processor/src/queues.ts @@ -125,7 +125,12 @@ export async function addProjectToQueues({ }: AddProjectToQueueData) { const inputDir = path.join(DATA_DIR, 'checkout', ownerName, repoName) - await sync(gitDir, inputDir) + try { + await sync(gitDir, inputDir) + } catch (e) { + log.warn('Released lock for', gitDir, 'after error:', e) + return + } const hash = await getGitHash(inputDir) const outputDir = path.join( @@ -226,7 +231,6 @@ async function sync(gitDir, checkoutDir) { } }) .then(() => log.debug('Released lock for ', gitDir)) - .catch(e => log.warn('Released lock for', gitDir, 'after error:', e)) } /**