From de4b9efe5e1427db885b11c2ac1c9c4b135af887 Mon Sep 17 00:00:00 2001 From: Redm4x <2829180+Redm4x@users.noreply.github.com> Date: Fri, 16 Aug 2024 15:19:10 -0400 Subject: [PATCH] fix(indexer): set grpc client idle timeout to 5min --- apps/indexer/src/providers/statusEndpointHandlers/grpc.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/indexer/src/providers/statusEndpointHandlers/grpc.ts b/apps/indexer/src/providers/statusEndpointHandlers/grpc.ts index f353fc5f0..572086cdf 100644 --- a/apps/indexer/src/providers/statusEndpointHandlers/grpc.ts +++ b/apps/indexer/src/providers/statusEndpointHandlers/grpc.ts @@ -1,4 +1,4 @@ -import { NodeResources, Storage } from "@akashnetwork/akash-api/akash/inventory/v1"; +import { NodeResources } from "@akashnetwork/akash-api/akash/inventory/v1"; import { ResourcesMetric, Status } from "@akashnetwork/akash-api/akash/provider/v1"; import { ProviderRPCClient } from "@akashnetwork/akash-api/akash/provider/v1/grpc-js"; import { Empty } from "@akashnetwork/akash-api/google/protobuf"; @@ -9,6 +9,7 @@ import { promisify } from "util"; import { parseDecimalKubernetesString, parseSizeStr } from "@src/shared/utils/files"; import { FakeInsecureCredentials } from "./fake-insecure-credentials"; import { ProviderStatusInfo } from "./types"; +import minutesToMilliseconds from "date-fns/minutesToMilliseconds"; export async function fetchProviderStatusFromGRPC(provider: Provider, timeout: number): Promise { const data = await queryStatus(provider.hostUri, timeout); @@ -104,7 +105,9 @@ const createProviderClient = memoize((hostUri: string) => { // TODO: refactor to use on-change cert validation // Issue: https://github.com/akash-network/console/issues/170 - const client = new ProviderRPCClient(url, FakeInsecureCredentials.createInsecure()); + const client = new ProviderRPCClient(url, FakeInsecureCredentials.createInsecure(), { + "grpc.client_idle_timeout_ms": minutesToMilliseconds(5) + }); const getStatus = promisify(client.getStatus.bind(client)); return {