Features: 1) Add task routing configuration for 'core.tasks.update_products_task' to use 'stock_updater' queue;

Fixes: 1) Remove deprecated `worker_autoscale` setting;

Extra: 1) Minor cleanup in Celery configuration; 2) Removed unused settings for `worker_prefetch_multiplier`, `worker_max_tasks_per_child`, `task_soft_time_limit`, and `task_time_limit`.
This commit is contained in:
Egor Pavlovich Gorbunov 2025-07-02 01:32:05 +03:00
parent 946a3e3de6
commit ed4d761741

View file

@ -14,7 +14,6 @@ app.conf.update(
worker_hijack_root_logger=False,
worker_log_format="[%(asctime)s: %(levelname)s/%(processName)s] %(name)s: %(message)s",
worker_task_log_format="[%(asctime)s: %(levelname)s/%(processName)s] %(name)s: %(message)s",
worker_autoscale=(10, 3),
broker_connection_retry_on_startup=True,
timezone=TIME_ZONE,
task_serializer="json",
@ -27,12 +26,12 @@ app.conf.update(
},
task_acks_late=True,
task_reject_on_worker_lost=True,
worker_prefetch_multiplier=1,
worker_max_tasks_per_child=100,
task_soft_time_limit=10800,
task_time_limit=21600,
)
app.conf.task_routes = {
'core.tasks.update_products_task': {'queue': 'stock_updater'},
}
app.config_from_object("django.conf:settings", namespace="CELERY")
app.autodiscover_tasks()