update:自动删除过期文件

This commit is contained in:
lan
2023-08-15 22:37:54 +08:00
parent 824d6e7cf2
commit d91d64cad5
7 changed files with 54 additions and 5 deletions
+1
View File
@@ -71,6 +71,7 @@ async def select_file(data: SelectFileModel, ip: str = Depends(error_ip_limit)):
if await file_code.is_expired():
return APIResponse(code=403, detail='文件已过期')
file_code.used_count += 1
file_code.expired_count -= 1
await file_code.save()
return APIResponse(detail={
'code': file_code.code,