grpc-caller
grpc-caller copied to clipboard
options.retry on the client is not working
I want to define the retries in one place on the client and then all methods should respect the retry number however this is not working as expected. Here is what I am doing:
const caller = require('grpc-caller');
const client = caller(
host,
proto,
name,
undefined,
{
retry: 3, // This number is not respected and retry will default to 5
},
);
const getMethod1 = client.Request('GetMethod1', {}).exec();
const getMethod2 = client.Request('GetMethod2', {}).exec();
The only way I found to get rid of this issue is to define the retry on every single method as follow:
const caller = require('grpc-caller');
const client = caller(
host,
proto,
name,
undefined,
);
const getMethod1 = client.Request('GetMethod1', {}).withRetry(3).exec();
const getMethod2 = client.Request('GetMethod2', {}).withRetry(3).exec();
It would be really nice to define the retry one time only instead of writing it on every single method.