mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 10:51:05 -05:00
logging
This commit is contained in:
@@ -239,6 +239,7 @@ class EnhancedVideoQueueManager:
|
|||||||
Args:
|
Args:
|
||||||
processor: A callable that takes a QueueItem and returns a tuple of (success: bool, error: Optional[str])
|
processor: A callable that takes a QueueItem and returns a tuple of (success: bool, error: Optional[str])
|
||||||
"""
|
"""
|
||||||
|
logger.info("Queue processor started and waiting for items...")
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
# Get next item from queue
|
# Get next item from queue
|
||||||
@@ -249,6 +250,7 @@ class EnhancedVideoQueueManager:
|
|||||||
self._processing[item.url] = item
|
self._processing[item.url] = item
|
||||||
item.status = "processing"
|
item.status = "processing"
|
||||||
item.processing_time = time.time()
|
item.processing_time = time.time()
|
||||||
|
logger.info(f"Processing queue item: {item.url}")
|
||||||
|
|
||||||
if not item:
|
if not item:
|
||||||
await asyncio.sleep(1)
|
await asyncio.sleep(1)
|
||||||
|
|||||||
@@ -45,10 +45,13 @@ class VideoProcessor:
|
|||||||
self._failed_downloads_lock = asyncio.Lock()
|
self._failed_downloads_lock = asyncio.Lock()
|
||||||
|
|
||||||
# Start queue processing
|
# Start queue processing
|
||||||
|
logger.info("Starting video processing queue...")
|
||||||
self._queue_task = asyncio.create_task(self.queue_manager.process_queue(self._process_video))
|
self._queue_task = asyncio.create_task(self.queue_manager.process_queue(self._process_video))
|
||||||
|
logger.info("Video processing queue started successfully")
|
||||||
|
|
||||||
async def _process_video(self, item: Any) -> Tuple[bool, Optional[str]]:
|
async def _process_video(self, item: Any) -> Tuple[bool, Optional[str]]:
|
||||||
"""Process a video from the queue"""
|
"""Process a video from the queue"""
|
||||||
|
logger.info(f"Processing video from queue: {item.url}")
|
||||||
try:
|
try:
|
||||||
# Get the message
|
# Get the message
|
||||||
channel = self.bot.get_channel(item.channel_id)
|
channel = self.bot.get_channel(item.channel_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user