modify: diskcache 缓存替换

This commit is contained in:
2026-04-13 15:55:12 +08:00
parent 6685bdb9a8
commit ee0a5cf0f6
26 changed files with 824 additions and 288 deletions
+8 -1
View File
@@ -20,12 +20,17 @@ pool_pre_ping = true
connect_args.timeout = 15
connect_args.check_same_thread = false
[scheduler]
job_store_path = "scheduler_jobs.db"
[cache]
cache_store_path = "./"
[security]
secret_key = "your-secret-key-change-in-production"
algorithm = "HS256"
access_token_expire_minutes = 30
refresh_token_expire_days = 7
jwt_cache_db_path = "jwt_cache"
max_sessions_per_user = 5
[development]
@@ -62,6 +67,8 @@ workers = 4
level = "INFO"
file = "logs/prod.log"
format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
max_size = 10485760 # 10MB
backup_count = 5 # 最多保存 10 个日志文件
[production.cors]
allow_origins = ["https://yourdomain.com", "http://localhost:8000", "http://127.0.0.1:8000"]
+2 -3
View File
@@ -1,7 +1,7 @@
# main.py - 修复 reload 问题
#!/usr/bin/env python3
"""
FastAPI + Tortoise-ORM + chongming 示例
FastAPI chongming 示例
主入口文件,适配 chongming 打包系统
"""
import sys
@@ -19,9 +19,8 @@ def app_run(app_config: dict, default_config: dict):
default_config: 默认配置
"""
import uvicorn
from app.core.logger import setup_logging, get_logger # type: ignore
from app.core.logger import get_logger # type: ignore
setup_logging(app_config["logging"])
logger = get_logger("app")
# 获取服务器配置