mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-18 22:17:44 +02:00
Adjusting arguments and return value of retry function and adding new retry logic to stream
This commit is contained in:
@ -300,7 +300,7 @@ func (r *rpcClient) Call(ctx context.Context, request Request, response interfac
|
||||
return nil
|
||||
}
|
||||
|
||||
if !callOpts.Retry(err) {
|
||||
if retry, err := callOpts.Retry(ctx, request, i, err); !retry {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -405,7 +405,12 @@ func (r *rpcClient) Stream(ctx context.Context, request Request, opts ...CallOpt
|
||||
if rsp.err == nil {
|
||||
return rsp.stream, nil
|
||||
}
|
||||
grr = rsp.err
|
||||
|
||||
if retry, err := callOpts.Retry(ctx, request, i, rsp.err); !retry {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
grr = err
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user