Skip to content

Commit

Permalink
fix(kook): ws client close may only use 1000
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed May 16, 2024
1 parent 9507f90 commit d1bf75d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adapters/kook/src/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class WsClient<C extends Context = Context> extends Adapter.WsClient<C, K
const send = () => {
if (!this.socket) return
if (trials >= 2) {
return this.socket.close(1013)
return this.socket.close(1000)
}
this.socket.send(JSON.stringify({ s: Signal.ping, sn: this._sn }))
this._ping = setTimeout(send, heartbeatIntervals[trials++] * Time.second)
Expand Down Expand Up @@ -58,7 +58,7 @@ export class WsClient<C extends Context = Context> extends Adapter.WsClient<C, K
} else if (parsed.s === Signal.pong) {
clearTimeout(this._ping)
} else if (parsed.s === Signal.resume) {
this.socket.close(1013)
this.socket.close(1000)
}
})
}
Expand Down

0 comments on commit d1bf75d

Please sign in to comment.