Made secure_delete_file and cleanup_downloads async in file_ops.py

Added chunked file processing and size limits to prevent blocking
Updated video_downloader.py to properly await secure_delete_file
Updated video_archiver.py to properly await cleanup_downloads
Simplified the secure deletion process while maintaining security
Added proper error handling and logging throughout
This commit is contained in:
pacnpal
2024-11-15 13:47:28 +00:00
parent 0194142c56
commit 0d7b1d449f
3 changed files with 43 additions and 58 deletions

View File

@@ -447,7 +447,7 @@ class VideoDownloader:
"""Safely delete a file with retries"""
for attempt in range(self.FILE_OP_RETRIES):
try:
if secure_delete_file(file_path):
if await secure_delete_file(file_path):
return True
await asyncio.sleep(self.FILE_OP_RETRY_DELAY * (attempt + 1))
except Exception as e: