fix: some error

This commit is contained in:
Lan
2025-12-01 11:30:52 +08:00
parent d96fa6ecc8
commit 4f10c0800b
7 changed files with 39 additions and 25 deletions
+8 -2
View File
@@ -30,8 +30,14 @@ async def delete_expire_files():
Q(expired_at__lt=await get_now()) | Q(expired_count=0)
).all()
for exp in expire_data:
await file_storage.delete_file(exp)
await exp.delete()
try:
await file_storage.delete_file(exp)
except Exception as e:
logging.error(f"删除过期文件失败 code={exp.code}: {e}")
try:
await exp.delete()
except Exception as e:
logging.error(f"删除记录失败 code={exp.code}: {e}")
except Exception as e:
logging.error(e)
finally: