feat: 支持缓存超时设置为-1表示永不自动删除

- file_cache.py: 清理任务检查 timeout=-1 时跳过删除
- admin.py: 后端验证允许 -1 值
- manage.html: 前端允许输入 -1,更新提示说明
- main.py: 启动时同步数据库缓存配置到 FileCache 实例
This commit is contained in:
axibayuit
2025-12-24 01:31:10 +08:00
parent 2f6fc345a9
commit 306ba90100
4 changed files with 18 additions and 8 deletions

View File

@@ -62,6 +62,10 @@ class FileCache:
async def _cleanup_expired_files(self):
"""Remove expired cache files"""
try:
# Skip cleanup if timeout is -1 (never delete)
if self.default_timeout == -1:
return
current_time = time.time()
removed_count = 0