mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-12 22:07:47 +02:00
Adjusting the logic around the returned error from the retry function
This commit is contained in:
@ -300,10 +300,16 @@ func (r *rpcClient) Call(ctx context.Context, request Request, response interfac
|
||||
return nil
|
||||
}
|
||||
|
||||
if retry, err := callOpts.Retry(ctx, request, i, err); !retry {
|
||||
retry, rerr := callOpts.Retry(ctx, request, i, err)
|
||||
if rerr != nil {
|
||||
return rerr
|
||||
}
|
||||
|
||||
if !retry {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
gerr = err
|
||||
}
|
||||
}
|
||||
@ -406,8 +412,13 @@ func (r *rpcClient) Stream(ctx context.Context, request Request, opts ...CallOpt
|
||||
return rsp.stream, nil
|
||||
}
|
||||
|
||||
if retry, err := callOpts.Retry(ctx, request, i, rsp.err); !retry {
|
||||
return nil, err
|
||||
retry, rerr := callOpts.Retry(ctx, request, i, rsp.err)
|
||||
if rerr != nil {
|
||||
return nil, rerr
|
||||
}
|
||||
|
||||
if !retry {
|
||||
return nil, rsp.err
|
||||
}
|
||||
|
||||
grr = err
|
||||
|
Reference in New Issue
Block a user