mirror of
https://github.com/stronk-dev/OrchestratorTracker.git
synced 2025-07-05 10:55:09 +02:00
Close client after each call to prevent too many open files
error on O's
This commit is contained in:
parent
edc0c3d710
commit
15d02182e2
@ -171,7 +171,6 @@ function hexToBytes(hex) {
|
|||||||
|
|
||||||
const discoverOrchestrator = async function (target) {
|
const discoverOrchestrator = async function (target) {
|
||||||
if (!target) { return; }
|
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 client = new livepeerProto.Orchestrator(target, ssl_creds, {"GRPC_ARG_DEFAULT_AUTHORITY": Math.random().toString(36).substr(2, 5)});
|
||||||
var receivedResults = false;
|
var receivedResults = false;
|
||||||
var orchestratorInfo;
|
var orchestratorInfo;
|
||||||
@ -192,6 +191,7 @@ const discoverOrchestrator = async function (target) {
|
|||||||
receivedResults = true;
|
receivedResults = true;
|
||||||
});
|
});
|
||||||
while (!receivedResults && new Date().getTime() - start < 4000) { await sleep(20); }
|
while (!receivedResults && new Date().getTime() - start < 4000) { await sleep(20); }
|
||||||
|
grpc.closeClient(client);
|
||||||
return { discoveryResults: orchestratorInfo, elapsed };
|
return { discoveryResults: orchestratorInfo, elapsed };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user