Skip to content

Commit

Permalink
Update pollOutstandingScans.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
azdak committed Nov 21, 2024
1 parent 30018a5 commit 93df5cf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/internal/pollOutstandingScans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ export const pollOutstandingScans = async ({ request, reply }) => {
failedJobs.push(job.job_id)
}
else if (['completed'].includes(status)) {
if(result == "null"){ // if result is complete but the data is empty, set processing to false;
await db.query({
text: `UPDATE "scans" SET "processing"=FALSE, "results"=$1 WHERE "job_id"=$2`,
values: [result, job.job_id],
});
continue;
}
const nodeIds = await ingestScanData( db, result, job.job_id, job.url_id, job.user_id );
processedJobs.push(nodeIds);
}
Expand Down

0 comments on commit 93df5cf

Please sign in to comment.