mirror of
https://github.com/bellingcat/whisperbox-transcribe.git
synced 2026-06-12 21:48:35 +03:00
refactor: use Depends for settings and session_local (#59)
This commit is contained in:
16
app/web/injections/task_queue.py
Normal file
16
app/web/injections/task_queue.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from functools import lru_cache
|
||||
|
||||
from fastapi import Depends
|
||||
|
||||
from app.shared.settings import Settings
|
||||
from app.web.injections.settings import get_settings
|
||||
from app.web.task_queue import TaskQueue
|
||||
|
||||
|
||||
@lru_cache
|
||||
def task_queue(broker_url: str):
|
||||
return TaskQueue(broker_url)
|
||||
|
||||
|
||||
def get_task_queue(settings: Settings = Depends(get_settings)):
|
||||
return task_queue(settings.BROKER_URL)
|
||||
Reference in New Issue
Block a user