mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 07:04:52 +09:00
Expect close in WsServer connection disconnect
Don't bother doing the prepareDisconnect dance if the connection is already broken. This avoids having to wait until the connection times out when a slave gives up on a current connection and starts a new one.
This commit is contained in:
1 parent
4a72c14b74
commit
bfec83996a
1 file changed
+1
@@ -64,6 +64,7 @@ class BaseConnection extends libLink.Link {
|
||||
}
|
||||
|
||||
async disconnect(code, reason) {
|
||||
this.connector.setClosing();
|
||||
try {
|
||||
await libLink.messages.prepareDisconnect.send(this);
|
||||
} catch (err) {
|
||||
|
||||
Reference in new issue
Block a user