All module components are now properly initialized and imported:

Database components with proper schema management
FFmpeg components with process management
Queue system with state management
Processor components with proper handlers
Utility components with shared instances
Configuration components with validation
Initialization sequence is now properly ordered:

Config Manager initialization
Path setup
Database initialization
FFmpeg setup
Queue Manager initialization
Video Processor setup
Guild Components initialization
Update Checker startup
Queue Processing start
Proper cleanup handling is in place:

Component cleanup in reverse order
Resource cleanup with timeouts
Force cleanup for hung processes
System-wide FFmpeg process cleanup
Health monitoring is implemented for all components:

Database connection monitoring
Queue health checks
Processor status tracking
Component state validation
This commit is contained in:
pacnpal
2024-11-16 16:43:02 +00:00
parent 871eccd978
commit e680002731
7 changed files with 183 additions and 17 deletions

View File

@@ -166,6 +166,15 @@ class VideoArchiver(GroupCog, Settings):
processor_status["active"]
)
# Check database health
db = self.db
if db:
db_status = await db.get_status()
self.status.update_health_check(
"database_health",
db_status["connected"]
)
except Exception as e:
logger.error(f"Error monitoring system health: {e}")
await asyncio.sleep(30) # Check every 30 seconds
@@ -208,6 +217,11 @@ class VideoArchiver(GroupCog, Settings):
"""Get the FFmpeg manager component"""
return self.component_accessor.get_component("ffmpeg_mgr")
@property
def db(self):
"""Get the database component"""
return self.component_accessor.get_component("db")
@property
def data_path(self):
"""Get the data path"""