fix: 基础目录设置

This commit is contained in:
lan committed 2024-01-18 18:46:16 +08:00
1 parent 31de5b7ea1
commit 222c048e38
1 file changed
+3 -2
+3 -2
View File
@@ -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)