fix: issue #186
This commit is contained in:
+3
-3
@@ -7,7 +7,7 @@ import asyncio
|
||||
from tortoise.expressions import Q
|
||||
|
||||
from apps.base.models import FileCodes
|
||||
from apps.base.utils import error_ip_limit, upload_ip_limit
|
||||
from apps.base.utils import ip_limit
|
||||
from core.settings import settings
|
||||
from core.storage import FileStorageInterface, storages
|
||||
from core.utils import get_now
|
||||
@@ -17,8 +17,8 @@ async def delete_expire_files():
|
||||
file_storage: FileStorageInterface = storages[settings.file_storage]()
|
||||
while True:
|
||||
try:
|
||||
await error_ip_limit.remove_expired_ip()
|
||||
await upload_ip_limit.remove_expired_ip()
|
||||
await ip_limit['error'].remove_expired_ip()
|
||||
await ip_limit['upload'].remove_expired_ip()
|
||||
expire_data = await FileCodes.filter(Q(expired_at__lt=await get_now()) | Q(expired_count=0)).all()
|
||||
for exp in expire_data:
|
||||
await file_storage.delete_file(exp)
|
||||
|
||||
Reference in New Issue
Block a user