From 5ff8540b220e08a99746daaff6bc33cde83f1581 Mon Sep 17 00:00:00 2001 From: Natty Date: Sun, 17 Nov 2024 19:26:31 +0100 Subject: [PATCH] Increased max listeners on the RPC socket --- packages/backend/src/mag/rpc-client.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/backend/src/mag/rpc-client.ts b/packages/backend/src/mag/rpc-client.ts index ec999dc0c2..d4799bce25 100644 --- a/packages/backend/src/mag/rpc-client.ts +++ b/packages/backend/src/mag/rpc-client.ts @@ -27,6 +27,7 @@ async function getRpcClient(): Promise { } client = new Socket(); + client.setMaxListeners(1024); const [host, portStr] = config.rpcHost.trim().split(/:(?=[0-9]+$)/, 2); const port = parseInt(portStr); @@ -94,6 +95,7 @@ async function getRpcClient(): Promise { const reconnectWithBackoff = () => { client!.destroy(); client = new Socket(); + client.setMaxListeners(1024); setTimeout(() => createClient(client!), 1000 * (1 + Math.pow(1.5, exponentialBackoff))); };