Skip to content

Commit 8cb6a04

Browse files
committed
🔧 Add timeouts to celery tasks
Done in the context of issue maykinmedia/charts#148
1 parent 2d1abfa commit 8cb6a04

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/openklant/conf/base.py

+11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from open_api_framework.conf.base import * # noqa
2+
from open_api_framework.conf.utils import config # noqa
23

34
from .api import * # noqa
45

@@ -50,3 +51,13 @@
5051
"openklant.setup_configuration.steps.TokenAuthConfigurationStep",
5152
"mozilla_django_oidc_db.setup_configuration.steps.AdminOIDCConfigurationStep",
5253
)
54+
55+
#
56+
# Celery
57+
#
58+
59+
# Add (by default) 5 (soft), 15 (hard) minute timeouts to all Celery tasks.
60+
CELERY_TASK_TIME_LIMIT = config("CELERY_TASK_HARD_TIME_LIMIT", default=15 * 60) # hard
61+
CELERY_TASK_SOFT_TIME_LIMIT = config(
62+
"CELERY_TASK_SOFT_TIME_LIMIT", default=5 * 60
63+
) # soft

0 commit comments

Comments
 (0)