mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-23 21:52:45 -05:00
feat(stats): add persistent tracks played counter with redis sync
This commit is contained in:
1 parent
1e02478fb6
commit
7bd80e62f7
10 files changed
+147
-6
No files matched your search
@@ -30,6 +30,7 @@ import { GatewayHandler } from "../voice/gateway/GatewayHandler.mjs";
|
||||
import { LastFmManager } from "../services/lastfm/LastFmManager.mjs";
|
||||
import { FluxerListManager } from "../services/FluxerListManager.mjs";
|
||||
import { TrackOptionsManager } from "../services/TrackOptionsManager.mjs";
|
||||
import { TrackStats } from "../music/TrackStats.mjs";
|
||||
import { configureBilibili } from "../music/bilibili/index.mjs";
|
||||
import { configureAudio } from "../music/audio/AudioSettings.mjs";
|
||||
import { applyMixins } from "../utils/mixins.mjs";
|
||||
@@ -145,6 +146,9 @@ class Remix {
|
||||
redis: config.dashboard?.redis,
|
||||
mysql: sharedPromisePool,
|
||||
});
|
||||
if (this.dashboard?.redis) {
|
||||
TrackStats.setRedis(this.dashboard.redis);
|
||||
}
|
||||
|
||||
const presenceContents = config.presenceContents ?? [];
|
||||
const presenceInterval = config.presenceInterval ?? 30_000;
|
||||
@@ -686,6 +690,10 @@ class Remix {
|
||||
logger.warn("[Shutdown] Lavalink cleanup error:", e?.message);
|
||||
}
|
||||
|
||||
try {
|
||||
TrackStats.save();
|
||||
} catch (_) {}
|
||||
|
||||
// 4. Close Redis if dashboard enabled
|
||||
try {
|
||||
if (this.dashboard?.redis?.destroy) {
|
||||
|
||||
Reference in new issue
Block a user