Skip to content

Commit 59fdeee

Browse files
committed
fix: catch processRepo failures in on-demand security contacts ingest
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
1 parent 1402d42 commit 59fdeee

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

services/apps/packages_worker/src/security-contacts/ingestSingle.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { getSecurityContactsConfig } from '../config'
55

66
import { buildBaseDeps, processRepo } from './processBatch'
77
import { RepoPackage, RepoTarget } from './types'
8+
import { markRepoAttempted } from './writeContacts'
89

910
const log = getServiceChildLogger('security-contacts-ondemand')
1011

@@ -90,7 +91,12 @@ export async function ingestSecurityContactsForPurl(
9091

9192
const target = toTarget(row)
9293
const baseDeps = buildBaseDeps(config)
93-
await processRepo(target, baseDeps, qx)
94+
try {
95+
await processRepo(target, baseDeps, qx)
96+
} catch (err) {
97+
log.error({ repoId: target.repoId, errMsg: (err as Error).message }, 'Repo processing failed')
98+
await markRepoAttempted(qx, target.repoId).catch(() => undefined)
99+
}
94100

95101
return { found: true, repoId: target.repoId }
96102
}

0 commit comments

Comments
 (0)