Skip to content

Commit

Permalink
Merge pull request #107 from uktrade/feature/resolve-celery
Browse files Browse the repository at this point in the history
feature/resolve-celery
  • Loading branch information
hareshkainthdbt authored Dec 10, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents cc209c8 + 891c6d2 commit 130a4ce
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions celery_worker/tasks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# flake8: noqa

import os
import time

import django

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fbr.settings")

# Initialize Django setup
django.setup()

from celery import shared_task

from app.cache.legislation import Legislation
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ services:
interval: 10s
timeout: 5s
retries: 2
start_period: 5s
start_period: 15s
depends_on:
- redis
- db
Expand Down
2 changes: 1 addition & 1 deletion fbr/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers.DatabaseScheduler"
CELERY_RESULT_EXTENDED = True
CELERY_TASK_TIME_LIMIT = (
450 # Maximum runtime for a task in seconds (e.g., 7.5 minutes)
900 # Maximum runtime for a task in seconds (e.g., 900/60 = 15 minutes)
)
CELERY_TASK_SOFT_TIME_LIMIT = (
270 # Optional: Grace period before forced termination
Expand Down

0 comments on commit 130a4ce

Please sign in to comment.