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,