fix: garbage collect job table + delete leaked ones (#4767)

This commit is contained in:
Lucas Abel
2024-11-21 09:02:24 +01:00
committed by GitHub
parent 2c451a5782
commit 40cc9cc007
6 changed files with 31 additions and 2 deletions
+9
View File
@@ -686,6 +686,15 @@ pub async fn delete_expired_items(db: &DB) -> () {
{
tracing::error!("Error deleting log file: {:?}", e);
}
if let Err(e) = sqlx::query!(
"DELETE FROM job WHERE id = ANY($1)",
&deleted_jobs
)
.execute(&mut *tx)
.await
{
tracing::error!("Error deleting job: {:?}", e);
}
}
}
Err(e) => {