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
2022-03-28 09:54:17 +02:00
committed by Thomas Lamprecht
parent b23adfd4ee
commit baefc29544
2 changed files with 35 additions and 8 deletions

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);
}
}