feat(coordinator-api): add database connection pooling configuration and comprehensive payment validation
- Add configurable database connection pool settings (pool_size, max_overflow, pool_recycle, pool_pre_ping, echo) - Replace hardcoded pool settings with environment-configurable values from settings - Add QueuePool explicitly to both sync and async database engines - Implement comprehensive Pydantic validators for payment schemas (JobPaymentCreate, PaymentRequest, ExchangePaymentRequest) - Add regex
This commit is contained in:
@@ -55,6 +55,13 @@ class Settings(BaseSettings):
|
||||
|
||||
# Database
|
||||
database: DatabaseConfig = DatabaseConfig()
|
||||
|
||||
# Database Connection Pooling
|
||||
db_pool_size: int = Field(default=20, description="Database connection pool size")
|
||||
db_max_overflow: int = Field(default=40, description="Maximum overflow connections")
|
||||
db_pool_recycle: int = Field(default=3600, description="Connection recycle time in seconds")
|
||||
db_pool_pre_ping: bool = Field(default=True, description="Test connections before using")
|
||||
db_echo: bool = Field(default=False, description="Enable SQL query logging")
|
||||
|
||||
# API Keys
|
||||
client_api_keys: List[str] = []
|
||||
|
||||
Reference in New Issue
Block a user