[#281] innerring: Create audit context once for one audit round

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-12-24 17:40:29 +03:00 committed by Alex Vanin
parent 0d7832f5e9
commit 77cf97c236

View file

@ -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,