feat: port lab3 backend foundation to lab4
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import os
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
app_name: str = "Messenger API"
|
||||
app_env: str = "lab"
|
||||
database_url: str = "postgresql+psycopg://messenger:messenger@postgres:5432/messenger"
|
||||
db_pool_size: int = 5
|
||||
db_max_overflow: int = 5
|
||||
db_pool_timeout: int = 10
|
||||
session_ttl_seconds: int = 3600
|
||||
cache_url: str = "redis://redis:6379/0"
|
||||
message_cache_ttl_seconds: int = 60
|
||||
idempotency_ttl_seconds: int = 86400
|
||||
instance_id: str = os.getenv("INSTANCE_ID") or os.getenv("HOSTNAME") or "api-local"
|
||||
shutdown_grace_seconds: int = 20
|
||||
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=".env", env_file_encoding="utf-8", extra="ignore"
|
||||
)
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user