2020-12-18 09:27:19 +00:00
|
|
|
package audit
|
|
|
|
|
|
|
|
import (
|
2023-04-12 14:35:10 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event"
|
2020-12-18 09:27:19 +00:00
|
|
|
"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()
|
|
|
|
|
2023-04-12 14:35:10 +00:00
|
|
|
ap.log.Info(logs.AuditNewRoundOfAudit, zap.Uint64("epoch", epoch))
|
2020-12-18 09:27:19 +00:00
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
// send an event to the worker pool
|
2020-12-18 09:27:19 +00:00
|
|
|
|
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 {
|
2023-04-12 14:35:10 +00:00
|
|
|
ap.log.Warn(logs.AuditPreviousRoundOfAuditPrepareHasntFinishedYet)
|
2020-12-18 09:27:19 +00:00
|
|
|
}
|
|
|
|
}
|