From 77cf97c236780563c8bd354dbf6f3f42ed65e004 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 24 Dec 2020 17:40:29 +0300 Subject: [PATCH] [#281] innerring: Create audit context once for one audit round Signed-off-by: Alex Vanin --- pkg/innerring/processors/audit/process.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/innerring/processors/audit/process.go b/pkg/innerring/processors/audit/process.go index 0e5bc0bb..28d01617 100644 --- a/pkg/innerring/processors/audit/process.go +++ b/pkg/innerring/processors/audit/process.go @@ -45,6 +45,9 @@ func (ap *Processor) processStartAudit(epoch uint64) { return } + var auditCtx context.Context + auditCtx, ap.prevAuditCanceler = context.WithCancel(context.Background()) + for i := range containers { cnr, err := ap.containerClient.Get(containers[i]) // get container structure if err != nil { @@ -79,9 +82,6 @@ func (ap *Processor) processStartAudit(epoch uint64) { zap.Stringer("cid", containers[i]), zap.Int("amount", len(storageGroups))) - var auditCtx context.Context - auditCtx, ap.prevAuditCanceler = context.WithCancel(context.Background()) - auditTask := new(audit.Task). WithReporter(&epochAuditReporter{ epoch: epoch,