feat: use pnpm & lock core-js shim

This commit is contained in:
2023-10-25 11:29:01 +08:00
parent 5bf4b1c09e
commit 54eaae96bd
32 changed files with 444 additions and 178 deletions

View File

@@ -9,7 +9,7 @@ export class WebSocketManager {
constructor() {
process.on('exit', () => {
for (const client of this.clients.values()) {
client.close(0, `client ${client.id} close connect`)
client.close(1000, `client ${client.id} close connect due process exit.`)
}
this.clients.clear()
})

View File

@@ -711,6 +711,7 @@ export class Socket extends Emitter<{}, {}, SocketReservedEvents> {
* @api private
*/
private resetPingTimeout() {
// @ts-ignore
this.clearTimeoutFn(this.pingTimeoutTimer)
this.pingTimeoutTimer = this.setTimeoutFn(() => {
this.onClose("ping timeout")
@@ -919,6 +920,7 @@ export class Socket extends Emitter<{}, {}, SocketReservedEvents> {
) {
debug('socket close with reason: "%s"', reason)
// @ts-ignore
// clear timers
this.clearTimeoutFn(this.pingTimeoutTimer)