From 222c048e384b2c97998f7fa5f23978272cd89647 Mon Sep 17 00:00:00 2001 From: lan Date: Thu, 18 Jan 2024 18:46:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9F=BA=E7=A1=80=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 2125aee..c31aa7e 100644 --- a/main.py +++ b/main.py @@ -27,12 +27,13 @@ async def startup(s: AsyncSession = Depends(get_session)): asyncio.create_task(delete_expire_files()) +BASE_DIR = Path(__file__).resolve().parent.parent # 数据存储文件夹 -DATA_ROOT = Path(settings.DATA_ROOT) +DATA_ROOT = BASE_DIR / settings.DATA_ROOT if not DATA_ROOT.exists(): DATA_ROOT.mkdir(parents=True) # 本地文件文件夹 -LOCAL_ROOT = Path(settings.LOCAL_ROOT) +LOCAL_ROOT = BASE_DIR / settings.LOCAL_ROOT if not LOCAL_ROOT.exists(): LOCAL_ROOT.mkdir(parents=True)