[#265] node: Fix after SDK & API-Go version up
All checks were successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/push/pre-commit Pipeline was successful

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-04-18 12:04:59 +03:00
parent a358255c1b
commit 3d43b0f7f9
9 changed files with 18 additions and 18 deletions

View file

@ -47,7 +47,7 @@ func newMultiClient(addr network.AddressGroup, opts ClientCacheOpts) *multiClien
}
}
func (x *multiClient) createForAddress(addr network.Address) (clientcore.Client, error) {
func (x *multiClient) createForAddress(ctx context.Context, addr network.Address) (clientcore.Client, error) {
var (
c client.Client
prmInit client.PrmInit
@ -73,7 +73,7 @@ func (x *multiClient) createForAddress(addr network.Address) (clientcore.Client,
}
c.Init(prmInit)
err := c.Dial(prmDial)
err := c.Dial(ctx, prmDial)
if err != nil {
return nil, fmt.Errorf("can't init SDK client: %w", err)
}
@ -144,7 +144,7 @@ func (x *multiClient) iterateClients(ctx context.Context, f func(clientcore.Clie
var err error
c, err := x.client(addr)
c, err := x.client(ctx, addr)
if err == nil {
err = f(c)
}
@ -297,8 +297,8 @@ func (x *multiClient) Close() error {
return nil
}
func (x *multiClient) RawForAddress(addr network.Address, f func(client *rawclient.Client) error) error {
c, err := x.client(addr)
func (x *multiClient) RawForAddress(ctx context.Context, addr network.Address, f func(client *rawclient.Client) error) error {
c, err := x.client(ctx, addr)
if err != nil {
return err
}
@ -310,7 +310,7 @@ func (x *multiClient) RawForAddress(addr network.Address, f func(client *rawclie
return err
}
func (x *multiClient) client(addr network.Address) (clientcore.Client, error) {
func (x *multiClient) client(ctx context.Context, addr network.Address) (clientcore.Client, error) {
strAddr := addr.String()
x.mtx.RLock()
@ -351,7 +351,7 @@ func (x *multiClient) client(addr network.Address) (clientcore.Client, error) {
return nil, errRecentlyFailed
}
cl, err := x.createForAddress(addr)
cl, err := x.createForAddress(ctx, addr)
if err != nil {
c.lastAttempt = time.Now()
return nil, err