MCPcopy Create free account
hub / github.com/authzed/authzed-node / deadlineInterceptor

Function deadlineInterceptor

src/util.ts:188–195  ·  view source on GitHub ↗
(timeoutInMS: number)

Source from the content-addressed store, hash-verified

186
187// Based on: https://github.com/grpc/grpc-node/issues/541#issuecomment-631191356
188export function deadlineInterceptor(timeoutInMS: number): grpc.Interceptor {
189 return (options: grpc.InterceptorOptions, nextCall: NextCall) => {
190 if (!options.deadline) {
191 options.deadline = Date.now() + (timeoutInMS ? timeoutInMS : 60000);
192 }
193 return new grpc.InterceptingCall(nextCall(options));
194 };
195}
196
197const authzedEndpoint = "grpc.authzed.com:443";
198

Callers 2

v1.test.tsFile · 0.85
constructorMethod · 0.85

Calls 1

nowMethod · 0.80

Tested by

no test coverage detected