Skip to content

Commit 418e40b

Browse files
committed
chore: update comments and timeout
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
1 parent 59fdeee commit 418e40b

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

backend/src/api/public/v1/packages/getPackage.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ export async function getPackage(req: Request, res: Response): Promise<void> {
6161
workflowId: ondemandWorkflowId(purl),
6262
workflowIdReusePolicy: WorkflowIdReusePolicy.ALLOW_DUPLICATE,
6363
workflowIdConflictPolicy: WorkflowIdConflictPolicy.USE_EXISTING,
64+
// Bounds the request's wait if packages-worker is down or its task queue is
65+
// backed up — the activity's startToCloseTimeout only starts counting once a
66+
// worker picks the task up, so without this the request could hang indefinitely.
67+
workflowExecutionTimeout: '60 seconds',
6468
args: [purl],
6569
})
6670
pkg = (await getPackageDetailByPurl(qx, purl)) ?? pkg

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ interface SingleRepoRow {
3232
// the shape the batch sweep builds.
3333
//
3434
// No host filter: processRepo already degrades gracefully for non-github repos (the
35-
// github-specific extractors no-op, security.txt/registry-manifest extractors still run)
36-
// and always stamps contacts_last_refreshed — filtering here would leave non-github repos
37-
// permanently NULL, re-triggering this on-demand path on every single request.
35+
// github-specific extractors no-op, security.txt/registry-manifest extractors still run)
36+
// filtering here would leave non-github repos permanently NULL, re-triggering this
37+
// on-demand path on every single request.
3838
async function findBestRepoForPurl(qx: QueryExecutor, purl: string): Promise<SingleRepoRow | null> {
3939
return qx.selectOneOrNone(
4040
`
@@ -76,7 +76,7 @@ function toTarget(row: SingleRepoRow): RepoTarget {
7676
/**
7777
* On-demand ingest for a single purl, bypassing the daily critical-only sweep.
7878
* Used when the akrites API hits a repo that has never been evaluated
79-
* (repos.contacts_last_refreshed IS NULL) — see security-contacts.md.
79+
* (repos.contacts_last_refreshed IS NULL).
8080
*/
8181
export async function ingestSecurityContactsForPurl(
8282
qx: QueryExecutor,

0 commit comments

Comments
 (0)