Skip to content

Commit 2785af8

Browse files
committed
Fix: scans stuck in running when catalog is not resolveable
When a scan has an unresolveable catalog (e.g. wrong credentials) then the scan was stuck in running because the tx.commit only happened if there were successful images. The fix is to commit outside the successful branch instead of in it.
1 parent 08e1d09 commit 2785af8

File tree

2 files changed

+1
-2
lines changed
  • rust
    • crates/greenbone-scanner-framework/src/models
    • src/openvasd/container_image_scanner/scheduling/db

2 files changed

+1
-2
lines changed

rust/crates/greenbone-scanner-framework/src/models/host_info.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ impl HostInfo {
5353

5454
pub fn finish(&mut self) {
5555
self.remaining_vts_per_host.clear();
56-
assert_eq!(self.queued, 0);
5756
}
5857

5958
pub fn update_with(mut self, other: &HostInfo) -> Self {

rust/src/openvasd/container_image_scanner/scheduling/db/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ pub async fn set_scan_images(
312312
});
313313
let query = builder.build();
314314
query.execute(&mut *tx).await?;
315-
tx.commit().await?;
316315
}
316+
tx.commit().await?;
317317
Ok(())
318318
}
319319

0 commit comments

Comments
 (0)