mirror of
https://github.com/bellingcat/auto-archiver-api.git
synced 2026-06-11 21:18:35 +03:00
introduces low/high priority queue and custom concurrency
This commit is contained in:
@@ -5,13 +5,17 @@ import redis
|
||||
|
||||
from app.shared.settings import get_settings
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_celery(name:str="") -> Celery:
|
||||
def get_celery(name: str = "") -> Celery:
|
||||
return Celery(
|
||||
name,
|
||||
broker_url=get_settings().CELERY_BROKER_URL,
|
||||
result_backend=get_settings().CELERY_BROKER_URL,
|
||||
broker_connection_retry_on_startup=False
|
||||
broker_connection_retry_on_startup=False,
|
||||
broker_transport_options={
|
||||
'queue_order_strategy': 'priority',
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user