2020-12-18 09:27:19 +00:00
|
|
|
package audit
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (ap *Processor) handleNewAuditRound(ev event.Event) {
|
|
|
|
auditEvent := ev.(Start)
|
2020-12-29 15:50:41 +00:00
|
|
|
|
|
|
|
epoch := auditEvent.Epoch()
|
|
|
|
|
|
|
|
ap.log.Info("new round of audit", zap.Uint64("epoch", epoch))
|
2020-12-18 09:27:19 +00:00
|
|
|
|
|
|
|
// send event to the worker pool
|
|
|
|
|
2020-12-29 15:50:41 +00:00
|
|
|
err := ap.pool.Submit(func() { ap.processStartAudit(epoch) })
|
2020-12-18 09:27:19 +00:00
|
|
|
if err != nil {
|
|
|
|
ap.log.Warn("previous round of audit prepare hasn't finished yet")
|
|
|
|
}
|
|
|
|
}
|