diff --git a/src/internal/pollOutstandingScans.ts b/src/internal/pollOutstandingScans.ts index d43ccf4..cb2f831 100644 --- a/src/internal/pollOutstandingScans.ts +++ b/src/internal/pollOutstandingScans.ts @@ -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); }