[#255] ir/audit: Make task manager to return number of skipped tasks

Add numeric return from TaskManager.Reset method that shows the number of
canceled tasks. This values will be used for assessment of the progress of
the audit.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-12-22 15:34:38 +03:00 committed by Alex Vanin
parent 03e3afb0e8
commit 2ebcbe70fb
3 changed files with 16 additions and 4 deletions

View file

@ -21,7 +21,13 @@ func (ap *Processor) processStartAudit(epoch uint64) {
log := ap.log.With(zap.Uint64("epoch", epoch))
ap.prevAuditCanceler()
ap.taskManager.Reset()
skipped := ap.taskManager.Reset()
if skipped > 0 {
ap.log.Info("some tasks from previous epoch are skipped",
zap.Int("amount", skipped),
)
}
containers, err := ap.selectContainersToAudit(epoch)
if err != nil {