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:
parent
946a3e3de6
commit
ed4d761741
1 changed files with 4 additions and 5 deletions
|
|
@ -14,7 +14,6 @@ app.conf.update(
|
||||||
worker_hijack_root_logger=False,
|
worker_hijack_root_logger=False,
|
||||||
worker_log_format="[%(asctime)s: %(levelname)s/%(processName)s] %(name)s: %(message)s",
|
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_task_log_format="[%(asctime)s: %(levelname)s/%(processName)s] %(name)s: %(message)s",
|
||||||
worker_autoscale=(10, 3),
|
|
||||||
broker_connection_retry_on_startup=True,
|
broker_connection_retry_on_startup=True,
|
||||||
timezone=TIME_ZONE,
|
timezone=TIME_ZONE,
|
||||||
task_serializer="json",
|
task_serializer="json",
|
||||||
|
|
@ -27,12 +26,12 @@ app.conf.update(
|
||||||
},
|
},
|
||||||
task_acks_late=True,
|
task_acks_late=True,
|
||||||
task_reject_on_worker_lost=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.config_from_object("django.conf:settings", namespace="CELERY")
|
||||||
|
|
||||||
app.autodiscover_tasks()
|
app.autodiscover_tasks()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue