Skip to content

Commit

Permalink
🔧 Add timeouts to celery tasks
Browse files Browse the repository at this point in the history
Done in the context of issue maykinmedia/charts#148
  • Loading branch information
SilviaAmAm committed Jan 10, 2025
1 parent 2d1abfa commit 8cb6a04
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/openklant/conf/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from open_api_framework.conf.base import * # noqa
from open_api_framework.conf.utils import config # noqa

from .api import * # noqa

Expand Down Expand Up @@ -50,3 +51,13 @@
"openklant.setup_configuration.steps.TokenAuthConfigurationStep",
"mozilla_django_oidc_db.setup_configuration.steps.AdminOIDCConfigurationStep",
)

#
# Celery
#

# Add (by default) 5 (soft), 15 (hard) minute timeouts to all Celery tasks.
CELERY_TASK_TIME_LIMIT = config("CELERY_TASK_HARD_TIME_LIMIT", default=15 * 60) # hard
CELERY_TASK_SOFT_TIME_LIMIT = config(
"CELERY_TASK_SOFT_TIME_LIMIT", default=5 * 60
) # soft

0 comments on commit 8cb6a04

Please sign in to comment.