Alex P
|
846caf77ce
|
refactor: improve code maintainability with focused handler functions
Extract large switch statements and functions into focused, reusable handlers
to improve code maintainability while preserving 100% functionality.
Changes:
- Extract onRPCMessage switch (200+ lines → 20 lines) into jsonrpc_session_handlers.go
- Extract cleanupInactiveSessions (343 lines → 54 lines) into session_cleanup_handlers.go
- Consolidate duplicate emergency promotion logic into attemptEmergencyPromotion()
- Simplify shouldBecomePrimary boolean logic with self-documenting variables
All changes pass linting (0 issues) and maintain complete functionality.
|
2025-10-17 11:29:04 +03:00 |