update celery settings
This commit is contained in:
@@ -58,6 +58,18 @@ CELERY_RESULT_BACKEND = "redis://redis:6379/0"
|
|||||||
CELERY_TIMEZONE = "UTC"
|
CELERY_TIMEZONE = "UTC"
|
||||||
CELERY_BEAT_SCHEDULER = 'django_celery_beat.schedulers:DatabaseScheduler'
|
CELERY_BEAT_SCHEDULER = 'django_celery_beat.schedulers:DatabaseScheduler'
|
||||||
|
|
||||||
|
# Kill any task that runs longer than 5 minutes — prevents a hung external
|
||||||
|
# call (Nobitex, bank verify, SMS) from freezing the worker pool indefinitely.
|
||||||
|
CELERY_TASK_TIME_LIMIT = 300
|
||||||
|
CELERY_TASK_SOFT_TIME_LIMIT = 240
|
||||||
|
|
||||||
|
# Recycle each worker child after 200 tasks to release memory/connections.
|
||||||
|
CELERY_WORKER_MAX_TASKS_PER_CHILD = 200
|
||||||
|
|
||||||
|
# Expire task results after 1 hour instead of the 1-day default. We don't
|
||||||
|
# read results, so this just keeps Redis lean.
|
||||||
|
CELERY_RESULT_EXPIRES = 3600
|
||||||
|
|
||||||
from celery.schedules import crontab
|
from celery.schedules import crontab
|
||||||
|
|
||||||
CELERY_BEAT_SCHEDULE = {
|
CELERY_BEAT_SCHEDULE = {
|
||||||
|
|||||||
Reference in New Issue
Block a user