fix: fixes

This commit is contained in:
itqop 2025-11-05 02:38:54 +03:00
parent 1789270d17
commit 71c03e71ef
1 changed files with 5 additions and 3 deletions

View File

@ -187,9 +187,11 @@ class QueueRepository:
""" """
Устанавливает флаг отмены для задачи. Устанавливает флаг отмены для задачи.
""" """
q = update(DLJob).where(DLJob.job_id == job_id).values(cancel_requested=True) job = await self._get(job_id)
await self.s.execute(q) if not job:
await self._append_event(job_id, await self._resolve_queue(job_id), "cancel_requested", None) return False
job.cancel_requested = True
await self._append_event(job_id, job.queue, "cancel_requested", None)
await self.s.commit() await self.s.commit()
return True return True