From 84ed23d09ffa6519545aaf74d37a8eea4ab48e14 Mon Sep 17 00:00:00 2001 From: bangbang93 Date: Tue, 25 May 2021 18:26:27 +0800 Subject: [PATCH] =?UTF-8?q?keep=20alive=E6=88=90=E5=8A=9F=E4=B9=9F?= =?UTF-8?q?=E7=BB=99=E6=97=A5=E5=BF=97=20enable=E5=A4=B1=E8=B4=A5=E5=B0=B1?= =?UTF-8?q?=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cluster.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cluster.ts b/src/cluster.ts index c720818..70bd6f9 100644 --- a/src/cluster.ts +++ b/src/cluster.ts @@ -147,10 +147,11 @@ export class Cluster { console.log('connected') try { await this._enable() + this.isEnabled = true } catch (e) { console.error(e) + process.exit(1) } - this.isEnabled = true }) this.io.on('message', (msg) => console.log(msg)) this.io.on('disconnect', (reason: string) => { @@ -222,6 +223,8 @@ export class Cluster { if (!status) { console.log('kicked by server') process.exit(1) + } else { + console.log('keep alive success') } this.keepAliveError = 0 } catch (e) {