[#222] auditsvc: Resolve containedctx linter

Resolve containedctx linter for commonCommunicatorPrm type.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-04-06 09:45:10 +03:00
parent fe87735073
commit 3dbff0a478
5 changed files with 9 additions and 15 deletions

View file

@ -131,7 +131,7 @@ func (c *ClientCache) getSG(ctx context.Context, addr oid.Address, nm *netmap.Ne
}
// GetHeader requests node from the container under audit to return object header by id.
func (c *ClientCache) GetHeader(prm auditor.GetHeaderPrm) (*object.Object, error) {
func (c *ClientCache) GetHeader(ctx context.Context, prm auditor.GetHeaderPrm) (*object.Object, error) {
var objAddress oid.Address
objAddress.SetContainer(prm.CID)
objAddress.SetObject(prm.OID)
@ -148,7 +148,7 @@ func (c *ClientCache) GetHeader(prm auditor.GetHeaderPrm) (*object.Object, error
return nil, fmt.Errorf("can't setup remote connection with %s: %w", info.AddressGroup(), err)
}
cctx, cancel := context.WithTimeout(prm.Context, c.headTimeout)
cctx, cancel := context.WithTimeout(ctx, c.headTimeout)
var obj *object.Object
@ -169,7 +169,7 @@ func (c *ClientCache) GetHeader(prm auditor.GetHeaderPrm) (*object.Object, error
// GetRangeHash requests node from the container under audit to return Tillich-Zemor hash of the
// payload range of the object with specified identifier.
func (c *ClientCache) GetRangeHash(prm auditor.GetRangeHashPrm) ([]byte, error) {
func (c *ClientCache) GetRangeHash(ctx context.Context, prm auditor.GetRangeHashPrm) ([]byte, error) {
var objAddress oid.Address
objAddress.SetContainer(prm.CID)
objAddress.SetObject(prm.OID)
@ -186,7 +186,7 @@ func (c *ClientCache) GetRangeHash(prm auditor.GetRangeHashPrm) ([]byte, error)
return nil, fmt.Errorf("can't setup remote connection with %s: %w", info.AddressGroup(), err)
}
cctx, cancel := context.WithTimeout(prm.Context, c.rangeTimeout)
cctx, cancel := context.WithTimeout(ctx, c.rangeTimeout)
h, err := frostfsapiclient.HashObjectRange(cctx, cli, objAddress, prm.Range)