We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f870895 commit 02a8e6cCopy full SHA for 02a8e6c
packages/app/src/app/overmind/effects/live/index.ts
@@ -84,6 +84,20 @@ export default new (class Live {
84
},
85
});
86
87
+ _socket.onClose(e => {
88
+ if (e.code === 1006) {
89
+ // This is an abrupt close, the server probably restarted or carshed. We don't want to overload
90
+ // the server, so we manually wait and try to connect;
91
+ _socket.disconnect();
92
+
93
+ const waitTime = 5000 * Math.random();
94
95
+ setTimeout(() => {
96
+ _socket.connect();
97
+ }, waitTime);
98
+ }
99
+ });
100
101
_socket.connect();
102
window.socket = _socket;
103
debug('Connecting to socket', _socket);
0 commit comments