Codebase list golang-github-vbauerster-mpb / f1d33f5
set completed in triggerCompletion Vladimir Bauer 1 year, 10 months ago
1 changed file(s) with 2 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
188188 }
189189 if s.current >= s.total {
190190 s.current = s.total
191 s.completed = true
192191 s.triggerCompletion(b)
193192 } else {
194193 s.triggerComplete = true
216215 }
217216 if complete {
218217 s.current = s.total
219 s.completed = true
220218 s.triggerCompletion(b)
221219 }
222220 }:
234232 s.current = current
235233 if s.triggerComplete && s.current >= s.total {
236234 s.current = s.total
237 s.completed = true
238235 s.triggerCompletion(b)
239236 }
240237 }:
256253 s.current = current
257254 if s.triggerComplete && s.current >= s.total {
258255 s.current = s.total
259 s.completed = true
260256 s.triggerCompletion(b)
261257 }
262258 result <- &wg
284280 s.current += n
285281 if s.triggerComplete && s.current >= s.total {
286282 s.current = s.total
287 s.completed = true
288283 s.triggerCompletion(b)
289284 }
290285 }:
313308 s.current += n
314309 if s.triggerComplete && s.current >= s.total {
315310 s.current = s.total
316 s.completed = true
317311 s.triggerCompletion(b)
318312 }
319313 result <- &wg
557551 return table
558552 }
559553
560 func (s bState) triggerCompletion(b *Bar) {
554 func (s *bState) triggerCompletion(b *Bar) {
555 s.completed = s.current == s.total
561556 if s.autoRefresh {
562557 // Technically this call isn't required, but if refresh rate is set to
563558 // one hour for example and bar completes within a few minutes p.Wait()