1 Commits

Author SHA1 Message Date
pixeebot[bot]
5f63a24659 Sandbox URL Creation 2025-04-03 03:45:27 +00:00
2 changed files with 7 additions and 4 deletions

View File

@@ -3,7 +3,6 @@
import os
import logging
import shutil
import requests
import tarfile
import zipfile
import subprocess
@@ -19,6 +18,7 @@ import lzma
# try:
# Try relative imports first
from exceptions import DownloadError
from security import safe_requests
# except ImportError:
# Fall back to absolute imports if relative imports fail
@@ -175,7 +175,7 @@ class FFmpegDownloader:
logger.info(f"Downloading FFmpeg from {url}")
try:
response = requests.get(url, stream=True, timeout=30)
response = safe_requests.get(url, stream=True, timeout=30)
response.raise_for_status()
total_size = int(response.headers.get("content-length", 0))

View File

@@ -341,11 +341,14 @@ class QueueCleaner:
metrics_manager.update_cleanup_time()
logger.info(
"%s%s%s", f"Cleanup completed ({mode.value}):\n", "\n".join(
f"Cleanup completed ({mode.value}):\n" +
"\n".join(
f"- {phase.value}: {count} items"
for phase, count in items_cleaned.items()
if count > 0
), f"\nTotal duration: {duration:.2f}s")
) +
f"\nTotal duration: {duration:.2f}s"
)
except Exception as e:
logger.error(f"Error during cleanup: {str(e)}")