forked from TrueCloudLab/frostfs-node
[#1437] node: Fix contextcheck linter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
6921a89061
commit
7429553266
209 changed files with 1068 additions and 1036 deletions
|
@ -1,6 +1,7 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
containercore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/container"
|
||||
|
@ -14,7 +15,7 @@ import (
|
|||
// along with sig.Key() and sig.Sign().
|
||||
//
|
||||
// Returns error if container is nil.
|
||||
func Put(c *Client, cnr containercore.Container) (*cid.ID, error) {
|
||||
func Put(ctx context.Context, c *Client, cnr containercore.Container) (*cid.ID, error) {
|
||||
data := cnr.Value.Marshal()
|
||||
|
||||
d := container.ReadDomain(cnr.Value)
|
||||
|
@ -35,7 +36,7 @@ func Put(c *Client, cnr containercore.Container) (*cid.ID, error) {
|
|||
prm.SetKey(sigV2.GetKey())
|
||||
prm.SetSignature(sigV2.GetSign())
|
||||
|
||||
err := c.Put(prm)
|
||||
err := c.Put(ctx, prm)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -95,7 +96,7 @@ func (p *PutPrm) SetZone(zone string) {
|
|||
// encountered that caused the saving to interrupt.
|
||||
//
|
||||
// If TryNotary is provided, calls notary contract.
|
||||
func (c *Client) Put(p PutPrm) error {
|
||||
func (c *Client) Put(ctx context.Context, p PutPrm) error {
|
||||
if len(p.sig) == 0 || len(p.key) == 0 {
|
||||
return errNilArgument
|
||||
}
|
||||
|
@ -116,7 +117,7 @@ func (c *Client) Put(p PutPrm) error {
|
|||
prm.SetMethod(method)
|
||||
prm.InvokePrmOptional = p.InvokePrmOptional
|
||||
|
||||
_, err := c.client.Invoke(prm)
|
||||
_, err := c.client.Invoke(ctx, prm)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not invoke method (%s): %w", method, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue