feat: 初始化零工后端代码
This commit is contained in:
23
gig-poc/apps/api/app/services/runtime_state.py
Normal file
23
gig-poc/apps/api/app/services/runtime_state.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from functools import lru_cache
|
||||
|
||||
from app.core.config import get_settings
|
||||
from app.services.ingest_queue import IngestQueue
|
||||
from app.services.match_queue import MatchQueue
|
||||
from app.services.traffic_guard import TrafficGuard
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_ingest_queue() -> IngestQueue:
|
||||
return IngestQueue(get_settings())
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_match_queue() -> MatchQueue:
|
||||
return MatchQueue(get_settings())
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_traffic_guard() -> TrafficGuard:
|
||||
return TrafficGuard(get_settings())
|
||||
Reference in New Issue
Block a user