mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
..
This commit is contained in:
1 parent
7fadc67ee4
commit
7dc883848f
1 file changed
+29
-1
+29
-1
@@ -2,7 +2,7 @@ import { Events, GatewayOpcodes } from "@fluxerjs/core";
|
||||
import { getVoiceManager } from "@fluxerjs/voice";
|
||||
import { logger } from "./constants/Logger.mjs";
|
||||
import { ServerSettings } from "./Settings.mjs";
|
||||
import { get247ChannelMode } from "./constants/Helpers247.mjs";
|
||||
import { get247ChannelMode, remove247ChannelMode } from "./constants/Helpers247.mjs";
|
||||
import mysql from "mysql2";
|
||||
|
||||
/**
|
||||
@@ -1427,6 +1427,34 @@ export class GatewayHandler {
|
||||
`[BootRecovery] Failed to rejoin channel ${channelId} (mode: ${mode}): ${errMsg}` +
|
||||
(bootRetries > 1 ? ` (after ${bootRetries} attempts)` : '')
|
||||
);
|
||||
|
||||
// Auto-cleanup: if all retries exhausted due to track publication
|
||||
// failure, remove the channel from 24/7 so it doesn't block boot
|
||||
// recovery on every restart.
|
||||
if (isTrackTimeout && bootRetries >= BOOT_MAX_RETRIES) {
|
||||
try {
|
||||
const set = remix.settingsMgr.getServer(guildId);
|
||||
if (set) {
|
||||
const raw = set.get("stay_247");
|
||||
const channels = new Set(
|
||||
(Array.isArray(raw) ? raw : [raw])
|
||||
.filter(id => id && id !== "none" && String(id).replace(/\D/g, "") !== channelId)
|
||||
);
|
||||
set.set("stay_247", channels.size > 0 ? [...channels] : "none");
|
||||
remove247ChannelMode(set, channelId, channels);
|
||||
logger.warn(
|
||||
`[BootRecovery] Auto-removed channel ${channelId} from 24/7 ` +
|
||||
`in guild ${guildId} after persistent track publication failure`
|
||||
);
|
||||
}
|
||||
} catch (cleanupErr) {
|
||||
logger.error(
|
||||
`[BootRecovery] Failed to auto-remove channel ${channelId} from 24/7:`,
|
||||
cleanupErr?.message ?? cleanupErr
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
break; // non-retryable error or max retries exhausted
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user