mirror of
https://github.com/clearml/clearml
synced 2025-06-26 18:16:07 +00:00
cleaned up exception handeling in cleanup_service.py
This commit is contained in:
parent
caddf25539
commit
5abe0791cb
@ -79,15 +79,18 @@ while True:
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
deleted_task = Task.get_task(task_id=task.id)
|
||||
deleted_task.delete(
|
||||
if deleted_task.delete(
|
||||
delete_artifacts_and_models=True,
|
||||
skip_models_used_by_other_tasks=True,
|
||||
raise_on_error=False
|
||||
)
|
||||
except Exception as ex:
|
||||
):
|
||||
logging.info(f'successfully deleted task with id {task.id}')
|
||||
else:
|
||||
logging.warning(f'could not delete task with id {task.id}, task.delete() returned false')
|
||||
except ValueError as e:
|
||||
logging.warning(
|
||||
"Could not delete Task ID={}, {}".format(
|
||||
task.id, ex.message if hasattr(ex, "message") else ex
|
||||
"Could not find Task ID={}, {}".format(
|
||||
task.id, e.message if hasattr(e, "message") else e
|
||||
)
|
||||
)
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user