mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-11 17:28:08 +00:00
fix: ensure stale monitoring is stopped on WebSocket error and closure events in LighterGateway for improved connection management
This commit is contained in:
@@ -557,6 +557,7 @@ export class LighterGateway {
|
|||||||
fail(new Error(`WebSocket closed before ready (code=${code}${normalizedReason ? `, reason=${normalizedReason}` : ""})`));
|
fail(new Error(`WebSocket closed before ready (code=${code}${normalizedReason ? `, reason=${normalizedReason}` : ""})`));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.stopStaleMonitor();
|
||||||
this.scheduleReconnect();
|
this.scheduleReconnect();
|
||||||
});
|
});
|
||||||
ws.on("error", (error) => {
|
ws.on("error", (error) => {
|
||||||
@@ -566,6 +567,7 @@ export class LighterGateway {
|
|||||||
fail(error);
|
fail(error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.stopStaleMonitor();
|
||||||
this.scheduleReconnect();
|
this.scheduleReconnect();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user