From 29d7f070686c66adc6f90033ebab2a5607d4fa19 Mon Sep 17 00:00:00 2001
From: xuyonghao <898441624@qq.com>
Date: 星期三, 25 十二月 2024 14:55:18 +0800
Subject: [PATCH] 新增合并Excel下载后删除相关文件

---
 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