From 15d02182e26ac20d71538eea1bf058a131eb0043 Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Wed, 19 Oct 2022 09:47:03 +0200 Subject: [PATCH] Close client after each call to prevent `too many open files` error on O's --- client/src/routes/orchTester.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/routes/orchTester.js b/client/src/routes/orchTester.js index 1cc74ac..e39b2c0 100644 --- a/client/src/routes/orchTester.js +++ b/client/src/routes/orchTester.js @@ -171,7 +171,6 @@ function hexToBytes(hex) { const discoverOrchestrator = async function (target) { if (!target) { return; } - var client = new livepeerProto.Orchestrator(target, ssl_creds); var client = new livepeerProto.Orchestrator(target, ssl_creds, {"GRPC_ARG_DEFAULT_AUTHORITY": Math.random().toString(36).substr(2, 5)}); var receivedResults = false; var orchestratorInfo; @@ -192,6 +191,7 @@ const discoverOrchestrator = async function (target) { receivedResults = true; }); while (!receivedResults && new Date().getTime() - start < 4000) { await sleep(20); } + grpc.closeClient(client); return { discoveryResults: orchestratorInfo, elapsed }; }