diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-10-25 11:26:04 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-10-25 12:06:03 +0200 |
commit | aba002b297a066d725ab75367ec5533dcafe16a9 (patch) | |
tree | 6986d9aac86edbef3168776b7ca3c7260d5a6c6b | |
parent | a134188bb169e246af96267a3ee813b508e22574 (diff) | |
download | Ishtar-aba002b297a066d725ab75367ec5533dcafe16a9.tar.bz2 Ishtar-aba002b297a066d725ab75367ec5533dcafe16a9.zip |
Celery: fix task already revoked or done
-rw-r--r-- | ishtar_common/utils.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index e48535991..a82a56f79 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -485,7 +485,11 @@ def revoke_old_task(kwargs, action_name, task_id, instance_cls): kwargs["action"] = action_name key, old_task_id = get_cache(instance_cls, kwargs) if old_task_id: - celery_app.control.revoke(old_task_id) + try: + celery_app.control.revoke(old_task_id) + except ConnectionResetError: + # task already revoked or done + pass cache.set(key, task_id, settings.CACHE_TIMEOUT * 4) |