mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-28 06:26:57 -05:00
Compare commits
1 Commits
pixeebot/d
...
pixeebot/d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e632f3a7f0 |
@@ -3,6 +3,7 @@
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
import shutil
|
import shutil
|
||||||
|
import requests
|
||||||
import tarfile
|
import tarfile
|
||||||
import zipfile
|
import zipfile
|
||||||
import subprocess
|
import subprocess
|
||||||
@@ -18,7 +19,6 @@ import lzma
|
|||||||
# try:
|
# try:
|
||||||
# Try relative imports first
|
# Try relative imports first
|
||||||
from exceptions import DownloadError
|
from exceptions import DownloadError
|
||||||
from security import safe_requests
|
|
||||||
|
|
||||||
# except ImportError:
|
# except ImportError:
|
||||||
# Fall back to absolute imports if relative imports fail
|
# Fall back to absolute imports if relative imports fail
|
||||||
@@ -175,7 +175,7 @@ class FFmpegDownloader:
|
|||||||
|
|
||||||
logger.info(f"Downloading FFmpeg from {url}")
|
logger.info(f"Downloading FFmpeg from {url}")
|
||||||
try:
|
try:
|
||||||
response = safe_requests.get(url, stream=True, timeout=30)
|
response = requests.get(url, stream=True, timeout=30)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
total_size = int(response.headers.get("content-length", 0))
|
total_size = int(response.headers.get("content-length", 0))
|
||||||
|
|||||||
@@ -341,14 +341,11 @@ class QueueCleaner:
|
|||||||
metrics_manager.update_cleanup_time()
|
metrics_manager.update_cleanup_time()
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
f"Cleanup completed ({mode.value}):\n" +
|
"%s%s%s", f"Cleanup completed ({mode.value}):\n", "\n".join(
|
||||||
"\n".join(
|
|
||||||
f"- {phase.value}: {count} items"
|
f"- {phase.value}: {count} items"
|
||||||
for phase, count in items_cleaned.items()
|
for phase, count in items_cleaned.items()
|
||||||
if count > 0
|
if count > 0
|
||||||
) +
|
), f"\nTotal duration: {duration:.2f}s")
|
||||||
f"\nTotal duration: {duration:.2f}s"
|
|
||||||
)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error during cleanup: {str(e)}")
|
logger.error(f"Error during cleanup: {str(e)}")
|
||||||
|
|||||||
Reference in New Issue
Block a user