forked from TrueCloudLab/frostfs-node
[#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:
parent
03e3afb0e8
commit
2ebcbe70fb
3 changed files with 16 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue