first
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
"""Settings."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from functools import lru_cache
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class WorkerSettings(BaseSettings):
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=".env", case_sensitive=False, extra="ignore"
|
||||
)
|
||||
asf_env: str = "development"
|
||||
asf_log_level: str = "INFO"
|
||||
rabbitmq_uri: str = "amqp://azurian:StrongPassword123!@172.19.40.201:5672/asf"
|
||||
mongo_uri: str = "mongodb://172.19.40.102:27017,172.19.40.103:27017/asf?replicaSet=rs0"
|
||||
mongo_db: str = "asf"
|
||||
ai_gateway_provider: str = "mock"
|
||||
|
||||
# Queue → routing key bindings consumed by this worker.
|
||||
# A single worker can subscribe to a subset; in production you'd run
|
||||
# separate worker deployments per queue pool.
|
||||
queues: list[str] = [
|
||||
"asf.ai.interactive",
|
||||
"asf.ai.background",
|
||||
"asf.indexing",
|
||||
"asf.code_analysis",
|
||||
"asf.testing",
|
||||
"asf.devops",
|
||||
"asf.notifications",
|
||||
]
|
||||
|
||||
# If true, AI jobs invoke the AI Gateway and write results back.
|
||||
enable_ai_handlers: bool = True
|
||||
|
||||
worker_id: str = "asf-worker-1"
|
||||
prefetch_count: int = 4
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def get_settings() -> WorkerSettings:
|
||||
return WorkerSettings()
|
||||
Reference in New Issue
Block a user