mirror of
https://github.com/clearml/clearml-session
synced 2025-01-30 18:36:54 +00:00
Make sure we delete old tasks artifcats as well when deleting old session tasks
This commit is contained in:
parent
4ad0e30091
commit
a843ef3321
@ -301,9 +301,13 @@ def delete_old_tasks(state, client, base_task_id):
|
||||
if state.get('verbose'):
|
||||
print('Removing {}/{} stale sessions'.format(i+1, len(previous_tasks)))
|
||||
try:
|
||||
client.tasks.delete(task=t.id, force=True)
|
||||
Task.get_task(task_id=t.id).delete(delete_artifacts_and_models=True, skip_models_used_by_other_tasks=True, raise_on_error=True)
|
||||
except Exception as ex:
|
||||
logging.getLogger().warning('{}\nFailed deleting old session {}'.format(ex, t.id))
|
||||
try:
|
||||
client.tasks.delete(task=t.id, force=True)
|
||||
except Exception as ex:
|
||||
logging.getLogger().warning('{}\nFailed deleting old session {}'.format(ex, t.id))
|
||||
|
||||
|
||||
def _get_running_tasks(client, prev_task_id):
|
||||
|
Loading…
Reference in New Issue
Block a user