[#182] pool: Fix linter error about deprecated methods
All checks were successful
DCO / DCO (pull_request) Successful in 1m11s
Tests and linters / Lint (pull_request) Successful in 1m30s
Tests and linters / Tests (1.20) (pull_request) Successful in 1m25s
Tests and linters / Tests (1.19) (pull_request) Successful in 1m1s

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
Airat Arifullin 2023-10-23 17:37:50 +03:00
parent 5804128ff3
commit 4c1feaf2cb

View file

@ -110,16 +110,11 @@ func (it *internalTarget) WriteObject(ctx context.Context, o *object.Object) err
}
func (it *internalTarget) putAsStream(ctx context.Context, o *object.Object) error {
var cliPrm sdkClient.PrmObjectPutInit
cliPrm.SetCopiesNumberByVectors(it.prm.copiesNumber)
if it.prm.stoken != nil {
cliPrm.WithinSession(*it.prm.stoken)
}
if it.prm.key != nil {
cliPrm.UseKey(*it.prm.key)
}
if it.prm.btoken != nil {
cliPrm.WithBearerToken(*it.prm.btoken)
cliPrm := sdkClient.PrmObjectPutInit{
CopiesNumber: it.prm.copiesNumber,
Session: it.prm.stoken,
Key: it.prm.key,
BearerToken: it.prm.btoken,
}
wrt, err := it.client.ObjectPutInit(ctx, cliPrm)
@ -141,16 +136,13 @@ func (it *internalTarget) tryPutSingle(ctx context.Context, o *object.Object) (b
if it.useStream {
return false, nil
}
var cliPrm sdkClient.PrmObjectPutSingle
cliPrm.SetCopiesNumber(it.prm.copiesNumber)
cliPrm.UseKey(it.prm.key)
if it.prm.stoken != nil {
cliPrm.WithinSession(*it.prm.stoken)
cliPrm := sdkClient.PrmObjectPutSingle{
CopiesNumber: it.prm.copiesNumber,
Key: it.prm.key,
Session: it.prm.stoken,
BearerToken: it.prm.btoken,
Object: o,
}
if it.prm.btoken != nil {
cliPrm.WithBearerToken(*it.prm.btoken)
}
cliPrm.SetObject(o.ToV2())
res, err := it.client.ObjectPutSingle(ctx, cliPrm)
if err != nil && status.Code(err) == codes.Unimplemented {