From 30c18d46cc6f9a68be564544dba607ea83190a82 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Wed, 29 Mar 2023 17:33:49 +0300 Subject: [PATCH] [#185] ir: Refactor audit Resolve funlen linter for processStartAudit method Signed-off-by: Dmitrii Stepanov --- pkg/innerring/processors/audit/process.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/innerring/processors/audit/process.go b/pkg/innerring/processors/audit/process.go index 3bdb00108b..7f148e57e6 100644 --- a/pkg/innerring/processors/audit/process.go +++ b/pkg/innerring/processors/audit/process.go @@ -17,7 +17,6 @@ import ( "go.uber.org/zap" ) -// nolint: funlen func (ap *Processor) processStartAudit(epoch uint64) { log := ap.log.With(zap.Uint64("epoch", epoch)) @@ -52,6 +51,10 @@ func (ap *Processor) processStartAudit(epoch uint64) { pivot := make([]byte, sha256.Size) + ap.startAuditTasksOnContainers(auditCtx, containers, log, pivot, nm, epoch) +} + +func (ap *Processor) startAuditTasksOnContainers(ctx context.Context, containers []cid.ID, log *zap.Logger, pivot []byte, nm *netmap.NetMap, epoch uint64) { for i := range containers { cnr, err := cntClient.Get(ap.containerClient, containers[i]) // get container structure if err != nil { @@ -104,7 +107,7 @@ func (ap *Processor) processStartAudit(epoch uint64) { epoch: epoch, rep: ap.reporter, }). - WithAuditContext(auditCtx). + WithAuditContext(ctx). WithContainerID(containers[i]). WithStorageGroupList(storageGroups). WithContainerStructure(cnr.Value).