feat: add PostgreSQL fallback for sessions and graceful degradation on Redis failure
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
This commit is contained in:
+4
-4
@@ -17,10 +17,10 @@ settings = Settings()
|
||||
engine = create_async_engine(
|
||||
settings.DATABASE_URL,
|
||||
echo=False,
|
||||
pool_size=10,
|
||||
max_overflow=20,
|
||||
pool_timeout=30,
|
||||
pool_recycle=1800
|
||||
pool_size=10, # Максимум 10 постоянных соединений
|
||||
max_overflow=20, # Допускается до 20 дополнительных при пике
|
||||
pool_timeout=30, # Таймаут ожидания соединения (сек)
|
||||
pool_recycle=1800 # Пересоздавать соединения каждые 30 минут
|
||||
)
|
||||
|
||||
async_session_maker = async_sessionmaker(engine, class_=AsyncSession, expire_on_commit=False)
|
||||
|
||||
Reference in New Issue
Block a user