feat(redis): decouple Redis service, add high-speed search caching, and 24/7 session restoration

- Add src/db/RedisManager.mjs to centralize Redis connection lifecycle and key namespacing
- Support top-level config.redis in src/core/Bot.mjs with fallback to dashboard.redis
- Implement query cache in src/music/LavalinkManager.mjs for instant (<1ms) audio search lookups
- Mirror player state checkpoints to Redis in src/db/PlayerStateStore.mjs for fast 24/7 recovery
- Add documented redis configuration block to config_example.json
This commit is contained in:
NoLogicAlan committed 2026-11-12 02:44:45 +03:00
1 parent 9ddbcb682f
commit 0d084bf127
5 files changed
+329 -37

No files matched your search

+7
View File
@@ -110,6 +110,13 @@
"connectionLimit": 15,
"connectionLimit-Comment": "Maximum simultaneous MySQL connections shared across all bot services (default: 15). Prevents connection pool exhaustion in multi-shard deployments."
},
"redis": {
"enabled": false,
"url": "redis://127.0.0.1:6379",
"password": null,
"searchTtlSeconds": 86400,
"Comment": "Centralized Redis service for ultra-fast track search caching (<1ms repeat lookups), 24/7 session restoration across bot reboots, and cross-shard atomic playback statistics. If disabled or omitted, searches fall back to direct Lavalink/NodeLink queries and sessions fall back to MySQL."
},
"dashboard": {
"enabled": false,
"redis": {