From 05265f1c57764ad633eaf8f3874025f33edb7ca4 Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Sat, 23 Nov 2024 13:48:08 -0300 Subject: [PATCH] Set channel to null when disconnected Signed-off-by: Marcos Candeia --- src/actors/proxyutil.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/actors/proxyutil.ts b/src/actors/proxyutil.ts index 2088aae..820aac6 100644 --- a/src/actors/proxyutil.ts +++ b/src/actors/proxyutil.ts @@ -74,6 +74,7 @@ export class ActorAwaiter< async close() { const ch = await this.channel; await ch.close(); + this.ch = null; } get signal() { return this.ctrl.signal; @@ -135,6 +136,7 @@ export class ActorAwaiter< return nextConnection(); } ch.close(); + this.ch = null; }; nextConnection().catch((err) => { console.error(`could not connect to websocket`, err);