Skip to content

Commit

Permalink
Fix: Set scan status to failed, if scan cannot be started
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Chandler authored and Kraemii committed Mar 6, 2024
1 parent 40e9f9d commit fb77d8c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion rust/openvasd/src/scheduling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,18 @@ where
queued.push(scan_id);
}
Err(e) => {
tracing::warn!(%scan_id, %e, "unable to start, removing from queue. Verify that scan using the API");
tracing::warn!(%scan_id, %e, "unable to start, removing from queue and set status to failed. Verify that scan using the API");
self.db
.update_status(
&scan_id,
models::Status {
start_time: None,
end_time: None,
status: Phase::Failed,
host_info: None,
},
)
.await?;
}
};
} else {
Expand Down

0 comments on commit fb77d8c

Please sign in to comment.