mirror of
https://github.com/spacebarchat/client.git
synced 2025-01-31 19:41:37 +01:00
disable gateway reconnect
This commit is contained in:
parent
07c63dee16
commit
1f8a887e01
@ -113,12 +113,12 @@ export default class GatewayConnectionStore {
|
||||
this.logger.debug(`[Disconnect] ${this.url}`);
|
||||
this.socket?.close(code, reason);
|
||||
}
|
||||
reconnecting=false;
|
||||
reconnecting = false;
|
||||
startReconnect() {
|
||||
if(this.reconnecting)return;
|
||||
this.reconnecting=true;
|
||||
if (this.reconnecting) return;
|
||||
this.reconnecting = true;
|
||||
setTimeout(() => {
|
||||
this.reconnecting=false;
|
||||
this.reconnecting = false;
|
||||
this.logger.debug("Starting reconnect...");
|
||||
this.connect(this.url!);
|
||||
}, this.reconnectTimeout);
|
||||
@ -339,16 +339,18 @@ export default class GatewayConnectionStore {
|
||||
// dont reconnect on "going away"
|
||||
if (code === 1001) return;
|
||||
|
||||
if (this.reconnectTimeout === 0) this.reconnectTimeout = RECONNECT_TIMEOUT;
|
||||
else this.reconnectTimeout += RECONNECT_TIMEOUT;
|
||||
// if (this.reconnectTimeout === 0) this.reconnectTimeout = RECONNECT_TIMEOUT;
|
||||
// else this.reconnectTimeout += RECONNECT_TIMEOUT;
|
||||
|
||||
this.logger.debug(
|
||||
`Websocket closed with code ${code}; Will reconnect in ${(this.reconnectTimeout / 1000).toFixed(
|
||||
2,
|
||||
)} seconds.`,
|
||||
);
|
||||
// this.logger.debug(
|
||||
// `Websocket closed with code ${code}; Will reconnect in ${(this.reconnectTimeout / 1000).toFixed(
|
||||
// 2,
|
||||
// )} seconds.`,
|
||||
// );
|
||||
|
||||
this.startReconnect();
|
||||
alert(`Gateway connection closed with code ${code}, please refresh the page`);
|
||||
|
||||
// this.startReconnect();
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user