initial commit
This commit is contained in:
21
infrastructure/config.py
Normal file
21
infrastructure/config.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import os
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Config:
|
||||
api_url: str
|
||||
api_key: str
|
||||
task_name: str
|
||||
max_retries: int
|
||||
retry_base_delay: float
|
||||
|
||||
@classmethod
|
||||
def from_env(cls) -> "Config":
|
||||
return cls(
|
||||
api_url=os.getenv("RAILWAY_API_URL", "https://hub.ag3nts.org/verify"),
|
||||
api_key=os.environ["RAILWAY_API_KEY"],
|
||||
task_name=os.getenv("RAILWAY_TASK_NAME", "railway"),
|
||||
max_retries=int(os.getenv("RAILWAY_MAX_RETRIES", "10")),
|
||||
retry_base_delay=float(os.getenv("RAILWAY_RETRY_BASE_DELAY", "2.0")),
|
||||
)
|
||||
Reference in New Issue
Block a user