From ee8df9424fc4e3fb30a8b8e39436b26c902defb7 Mon Sep 17 00:00:00 2001 From: zhaoqingang <zhaoqg0118@163.com> Date: 星期二, 24 十二月 2024 13:37:15 +0800 Subject: [PATCH] 角色的资源过滤掉删除的 --- 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