When removing a task from a queue change the task state only if the task does not think that it is enqueued in some other place

This commit is contained in:
clearml 2024-12-05 22:16:14 +02:00
parent 4b93f1f508
commit a1956cdd83

View File

@ -150,6 +150,7 @@ class QueueBLL(object):
task = Task.get( task = Task.get(
company=company_id, company=company_id,
id=task_id, id=task_id,
execution__queue=queue_id,
_only=[ _only=[
"id", "id",
"company", "company",
@ -169,7 +170,10 @@ class QueueBLL(object):
status_message="", status_message="",
user_id=user_id, user_id=user_id,
force=True, force=True,
).execute(enqueue_status=None) ).execute(
enqueue_status=None,
unset__execution__queue=1,
)
except Exception as ex: except Exception as ex:
log.error( log.error(
f"Failed updating task {task_id} status on removal from queue: {queue_id}, {str(ex)}" f"Failed updating task {task_id} status on removal from queue: {queue_id}, {str(ex)}"