Skip to content

Commit

Permalink
setting the correct keep alive timeouts in grpc clients to reset the …
Browse files Browse the repository at this point in the history
…idle timeouts over NLB
  • Loading branch information
aman-bansal committed Jul 13, 2021
1 parent 0b7416c commit 5a4073b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/clientStubFromSlash.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as grpc from "@grpc/grpc-js";
import * as Url from "url-parse";
import { DgraphClientStub } from "./clientStub";
import {DgraphClientStub} from "./clientStub";

const PORT = "443";

/**
* @deprecated since v21.3 and will be removed in v21.07 release.
* Please use {@link clientStubFromCloudEndpoint} instead.
Expand Down Expand Up @@ -39,5 +40,9 @@ export function clientStubFromCloudEndpoint(
grpc.credentials.createSsl(),
metaCreds,
);
return new DgraphClientStub(backenedURL, credentials);
return new DgraphClientStub(backenedURL, credentials, {
"grpc.keepalive_time_ms": 60 * 1000,
"grpc.keepalive_timeout_ms": 10 * 1000,
"grpc.keepalive_permit_without_calls": true,
});
}

0 comments on commit 5a4073b

Please sign in to comment.