Skip to content

Commit 30121fa

Browse files
fix(scan): sync remote CSV before fetching URLs in rescanAudit
1 parent 3048dae commit 30121fa

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

apps/backend/routes/auth/rescanAudit.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ export const rescanAudit = async () => {
77
const { id: audit_id } = event.body;
88

99
await db.connect();
10+
11+
// sync remote CSV first so the scan runs against the fresh URL list (#628)
12+
await syncAuditUrlsFromRemoteCsv(audit_id);
13+
1014
const urls = (await db.query({
1115
text: `SELECT * FROM "urls" WHERE "audit_id"=$1`,
1216
values: [audit_id],
1317
})).rows;
1418
console.log('Found URLs for audit:', { auditId: audit_id, count: urls?.length, urls });
1519

16-
// hook to check for remote CSV
17-
await syncAuditUrlsFromRemoteCsv(audit_id);
18-
1920
// Handle empty URLs case - create a complete scan immediately
2021
if (!urls || urls.length === 0) {
2122
console.log('No URLs found for audit, creating completed scan with no_urls error');

0 commit comments

Comments
 (0)