forked from TrueCloudLab/frostfs-http-gw
Add connection pool implementation (part 2)
Signed-off-by: Pavel Korotkov <pavel@nspcc.ru>
This commit is contained in:
parent
62a03251ce
commit
a44551d42b
6 changed files with 70 additions and 57 deletions
|
@ -80,6 +80,9 @@ type neofsClientPlant struct {
|
|||
|
||||
func (cp *neofsClientPlant) GetReusableArtifacts(ctx context.Context) (client.Client, *token.SessionToken, error) {
|
||||
c := cp.pool.Client()
|
||||
if c == nil {
|
||||
return nil, nil, errors.New("failed to peek a healthy node to connect to")
|
||||
}
|
||||
st, err := c.CreateSession(ctx, math.MaxUint64)
|
||||
if err != nil {
|
||||
return nil, nil, errors.Wrap(err, "failed to create reusable neofs session token")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue