mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
fix: cap Discord gateway reconnect attempts to prevent infinite loop
The Discord GatewayPlugin was configured with maxAttempts: Infinity, which causes an unbounded reconnection loop when the Discord gateway enters a persistent failure state (e.g. code 1005 with stalled HELLO). In production, this manifested as 2,483+ reconnection attempts in a single log file, starving the Node.js event loop and preventing cron, heartbeat, and other subsystems from functioning. Cap maxAttempts at 50, which provides ~25 minutes of retry time (with 30s HELLO timeout between attempts) before cleanly exiting via the existing "Max reconnect attempts" error handler. Closes #11836 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -504,7 +504,7 @@ export async function monitorDiscordProvider(opts: MonitorDiscordOpts = {}) {
|
||||
[
|
||||
new GatewayPlugin({
|
||||
reconnect: {
|
||||
maxAttempts: Number.POSITIVE_INFINITY,
|
||||
maxAttempts: 50,
|
||||
},
|
||||
intents: resolveDiscordGatewayIntents(discordCfg.intents),
|
||||
autoInteractions: true,
|
||||
|
||||
Reference in New Issue
Block a user