diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-10-25 11:26:04 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-07-08 09:58:49 +0200 | 
| commit | 0b11330169d6bd9f5ce470d082eec11ec8f8e39a (patch) | |
| tree | 7cbd859681e7c3be2cd36a3d5a79a1b7ae1efcaa | |
| parent | 53a17f359daa1844622fdcfb918b4f776edd4b60 (diff) | |
| download | Ishtar-0b11330169d6bd9f5ce470d082eec11ec8f8e39a.tar.bz2 Ishtar-0b11330169d6bd9f5ce470d082eec11ec8f8e39a.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 7173a2c46..77748143c 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -486,7 +486,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) | 
