mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-21 03:11:07 -05:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user