(timeoutInMS: number)
| 186 | |
| 187 | // Based on: https://github.com/grpc/grpc-node/issues/541#issuecomment-631191356 |
| 188 | export 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 | |
| 197 | const authzedEndpoint = "grpc.authzed.com:443"; |
| 198 |
no test coverage detected