rest-server: cleanup_old_tasks: improve error handling

by not bubbling up most errors, and continuing on. this avoids that we
stop cleaning up because e.g. one directory was missing.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak authored and Thomas Lamprecht committed 2022-04-06 17:10:02 +02:00
1 parent b23adfd4ee
commit baefc29544
2 files changed
+35 -8

No files matched your search

+1 -1
View File
@@ -900,7 +900,7 @@ async fn schedule_task_log_rotate() {
if has_rotated {
task_log!(worker, "cleaning up old task logs");
if let Err(err) = cleanup_old_tasks(true) {
if let Err(err) = cleanup_old_tasks(&worker, true) {
task_warn!(worker, "could not completely cleanup old tasks: {}", err);
}
}