[#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

@ -1,8 +1,11 @@
package audittask
// Reset pops all tasks from the queue.
func (m *Manager) Reset() {
for len(m.ch) > 0 {
// Returns amount of popped elements.
func (m *Manager) Reset() (popped int) {
for ; len(m.ch) > 0; popped++ {
<-m.ch
}
return
}