morph: Reconnect to the highest priority endpoint, support/v0.42 #1293

Merged
fyrchik merged 1 commit from dstepanov-yadro/frostfs-node:fix/morph_reconnect_v0.42 into support/v0.42 2024-08-05 10:31:03 +00:00

View file

@ -148,6 +148,10 @@ func New(ctx context.Context, key *keys.PrivateKey, opts ...Option) (*Client, er
} else {
cli.logger.Info(logs.FrostFSIRCreatedRPCClientForEndpoint,
zap.String("endpoint", endpoint.Address))
if cli.endpoints.curr > 0 && cli.cfg.switchInterval != 0 {
cli.switchIsActive.Store(true)
go cli.switchToMostPrioritized(ctx)
}
break
}
}