Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/resolve-celery #107

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading