Commit Graph

17 Commits

Author SHA1 Message Date
pacnpal
fa494dccd3 fix 2024-11-16 01:57:41 +00:00
pacnpal
18792c77f2 fix 2024-11-16 01:50:34 +00:00
pacnpal
669db54442 Added proper error handling in enable_database command to handle cases where the setting doesn't exist yet
Fixed redbot import issues by importing specific exception classes
Ensured database setting is properly synchronized between base.py and config_manager.py
Added proper database initialization and reference handling
2024-11-16 01:43:17 +00:00
pacnpal
372b7de34a Changed the default "enabled" setting in base.py from True to False to match config_manager.py's default.
Fixed the command error handling by properly referencing the commands from redbot.core.commands instead of using the bare 'commands' reference.
2024-11-16 01:33:59 +00:00
pacnpal
609aecdc4e Updated default settings (video archiving enabled by default)
New database functionality and commands
Additional video format support (MKV)
Message duration now in hours (0-168)
Enhanced error handling and logging
Queue persistence and management improvements
Hardware acceleration updates
More detailed command descriptions
Improved performance & limitations documentation
2024-11-16 01:22:37 +00:00
pacnpal
01a9067368 Added proper command validation in the on_message event handler to prevent interference with command processing
Added missing asyncio import in events.py
Ensured all long-running operations are handled in background tasks
Fixed task initialization and management in base.py
2024-11-16 01:04:08 +00:00
pacnpal
32c63deeff Removed the problematic singleton pattern from queue manager
Added proper activity tracking in the monitoring system
Reduced timeouts and deadlock thresholds
Implemented more aggressive cleanup procedures
Added system-wide FFmpeg process cleanup
2024-11-16 00:24:28 +00:00
pacnpal
53e7769811 Added proper initialization sequence in the queue manager:
Sequential component initialization
Coordination through an _initialized event
Consistent lock hierarchy with _global_lock
Updated the base cog to properly initialize components:
Added timeout handling for queue manager initialization
Ensures queue manager is fully initialized before starting queue processing
Added proper error handling and cleanup
Established consistent lock ordering:
Global Lock -> Queue Lock -> Processing Lock
Prevents circular wait conditions
Each component respects the lock hierarchy
Improved task coordination:
Sequential initialization of components
Proper waiting for initialization before starting operations
Timeout handling for all async operations
2024-11-15 23:04:13 +00:00
pacnpal
c122319eb9 Added the missing process_video method to VideoProcessor that properly delegates to QueueHandler
Modified the initialization process to start queue processing as a non-blocking background task
Added proper cleanup of the queue task during cog unload
Optimized the queue manager's process_queue method to:
Use shorter sleep times (0.1s) when queue is empty
Persist state less frequently (every 60s)
Better handle task switching with asyncio.sleep(0)
Improve error recovery with brief pauses
These changes resolve both the initial "process_video missing" error and the subsequent "initialization timeout" error by:

Properly implementing the missing method
Making queue processing non-blocking during initialization
Ensuring proper cleanup of all tasks
Optimizing the queue processing loop for better performance
2024-11-15 22:48:54 +00:00
pacnpal
512dd1ff88 Eliminating duplicate queue processing that was causing race conditions
Adding proper processing state tracking and timing
Implementing more aggressive monitoring (1-minute intervals)
Adding activity tracking to detect and recover from hung states
Improving error handling and logging throughout the system
Reducing timeouts and deadlock thresholds for faster recovery
2024-11-15 22:38:36 +00:00
pacnpal
87605ad7f1 Added extremely aggressive timeouts:
CLEANUP_TIMEOUT = 1s
UNLOAD_TIMEOUT = 2s
INIT_TIMEOUT = 5s
COMPONENT_INIT_TIMEOUT = 2s
Added timeout protection for all async operations:

Download cleanup
Guild component initialization
Update checker start
Cleanup processes
Force cleanup fallbacks
Improved cleanup process:

Immediate task cancellation
Aggressive reference clearing
Force cleanup fallbacks
Comprehensive error logging
2024-11-15 21:49:58 +00:00
pacnpal
2025c4e8f0 Fixed the guild_only import by importing it directly from redbot.core.commands
Improved the cog unload process by:
Reducing cleanup timeouts (UNLOAD_TIMEOUT to 5s, CLEANUP_TIMEOUT to 3s)
Adding immediate task cancellation
Implementing aggressive cleanup with force_cleanup_resources
Clearing all references in the finally block
Fixed code indentation issues
2024-11-15 21:39:19 +00:00
pacnpal
29f7a6345e fix 2024-11-15 21:22:55 +00:00
pacnpal
e8f02c2b59 fix 2024-11-15 21:19:52 +00:00
pacnpal
1748ab2188 Changed VideoArchiver to inherit from GroupCog instead of Cog
Moved all command definitions directly into the VideoArchiver class
Updated command decorators to use proper hybrid_group and hybrid_command syntax
Properly set up command error handling within the class
Removed external command setup in favor of class-based commands
Maintained backward compatibility through a stub commands.py file
2024-11-15 20:18:51 +00:00
pacnpal
121e1395f4 Updated default_guild_settings in core/base.py from 25MB to 8MB
Verified consistency with config_manager.py which already had 8MB as default
Confirmed proper validation in config_manager.py (allows 1-100MB range)
Verified all other files reference the max_file_size setting correctly
2024-11-15 20:11:43 +00:00
pacnpal
42b3ceb314 Created /core module with specialized files:
base.py: Main cog class and initialization logic
cleanup.py: Resource cleanup functionality
commands.py: Command handlers
events.py: Event listeners
guild.py: Guild component management
init.py: Module exports
Improved code organization by:

Separating concerns into focused modules
Maintaining clear dependencies between modules
Keeping related functionality together
Making the codebase more maintainable
Preserved all existing functionality while making the code more modular and easier to maintain.
2024-11-15 20:01:45 +00:00