Skip to content

Commit 12447a9

Browse files
committed
setting the correct keep alive timeouts in grpc clients to reset the idle timeouts over NLB
1 parent 0b7416c commit 12447a9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/clientStubFromSlash.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import * as grpc from "@grpc/grpc-js";
22
import * as Url from "url-parse";
3-
import { DgraphClientStub } from "./clientStub";
3+
import {DgraphClientStub} from "./clientStub";
44

55
const PORT = "443";
6+
67
/**
78
* @deprecated since v21.3 and will be removed in v21.07 release.
89
* Please use {@link clientStubFromCloudEndpoint} instead.
@@ -39,5 +40,9 @@ export function clientStubFromCloudEndpoint(
3940
grpc.credentials.createSsl(),
4041
metaCreds,
4142
);
42-
return new DgraphClientStub(backenedURL, credentials);
43+
return new DgraphClientStub(backenedURL, credentials, {
44+
"grpc.keepalive_time_ms": 60 * 1000,
45+
"grpc.keepalive_timeout_ms": 10 * 1000,
46+
"grpc.keepalive_permit_without_calls": 1,
47+
});
4348
}

0 commit comments

Comments
 (0)