From 2d0c7b15898e16ab4bdc22bd95c23b13e3455c0a Mon Sep 17 00:00:00 2001 From: xuyonghao <898441624@qq.com> Date: 星期三, 25 十二月 2024 14:24:12 +0800 Subject: [PATCH] 合并webSocket修改 --- app/models/base_model.py | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/base_model.py b/app/models/base_model.py index 969c9c3..580f262 100644 --- a/app/models/base_model.py +++ b/app/models/base_model.py @@ -1,12 +1,14 @@ +import os + from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker, Session from app.config.config import settings -DATABASE_URL = settings.database_url +DATABASE_URL = os.getenv('DATABASE_URL') or settings.database_url -engine = create_engine(DATABASE_URL) +engine = create_engine(DATABASE_URL, pool_size=20, max_overflow=50) SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) Base = declarative_base() -- Gitblit v1.8.0