From 7c3bb0d061a4838f9c93787d66af822863de01fe Mon Sep 17 00:00:00 2001 From: John Nagro Date: Thu, 11 Jan 2024 19:01:57 +0000 Subject: [PATCH] fix: task recovery when autoscaler kills pod --- enterprise_catalog/settings/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/enterprise_catalog/settings/base.py b/enterprise_catalog/settings/base.py index bd4fef145..55aef03fe 100644 --- a/enterprise_catalog/settings/base.py +++ b/enterprise_catalog/settings/base.py @@ -346,6 +346,10 @@ # see https://github.com/celery/django-celery-results/issues/326 # on CELERY_RESULT_EXTENDED CELERY_RESULT_EXTENDED = True +# these settings allow recovery when autoscaling ends up killing a task +# see https://stackoverflow.com/a/45059806 +CELERY_ACKS_LATE = True +CELERY_TASK_REJECT_ON_WORKER_LOST = True # Celery task time limits. # Tasks will be asked to quit after 15 minutes...