Implement Trivy adapter, contain job panics, fail interrupted runs on startup
The Trivy scanner still had unimplemented stubs, which panicked the scan task in the deployed test instance and left the run in 'running' forever. JobRunner now runs handlers in their own task and marks a panic as a failed run; on startup runs left 'running' by a previous process are marked failed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@ -292,6 +292,16 @@ impl JobRunRepository for MemJobRuns {
|
||||
.find(|r| r.kind == kind && r.status != JobStatus::Running)
|
||||
.cloned())
|
||||
}
|
||||
async fn running(&self) -> Result<Vec<JobRun>, DomainError> {
|
||||
Ok(self
|
||||
.0
|
||||
.lock()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.filter(|r| r.status == JobStatus::Running)
|
||||
.cloned()
|
||||
.collect())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn smtp() -> SmtpSettings {
|
||||
|
||||
Reference in New Issue
Block a user