mirror of
https://github.com/stronk-dev/OrchestratorTracker.git
synced 2025-07-05 02:45:10 +02:00
Use a fresh client to prevent connections from being reused (#4)
This commit is contained in:
parent
5fa08800bf
commit
d4e1c33702
@ -171,7 +171,7 @@ 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;
|
||||
const start = new Date().getTime();
|
||||
@ -191,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 };
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user