tq: TransferQueue flushes, but does not close the Meter

This commit is contained in:
rick olson 2018-01-04 11:49:41 -07:00
parent ba4a73d6a9
commit 8c59efb1e5
3 changed files with 11 additions and 1 deletions

@ -258,6 +258,7 @@ func (c *uploadContext) CollectErrors(tqueues ...*tq.TransferQueue) {
}
func (c *uploadContext) ReportErrors() {
c.meter.Finish()
for _, err := range c.otherErrs {
FullError(err)
}

@ -163,6 +163,15 @@ func (m *Meter) FinishTransfer(name string) {
m.fileIndexMutex.Unlock()
}
// Flush sends the latest progress update, while leaving the meter active.
func (m *Meter) Flush() {
if m == nil {
return
}
m.update()
}
// Finish shuts down the Meter.
func (m *Meter) Finish() {
if m == nil {

@ -768,7 +768,7 @@ func (q *TransferQueue) Wait() {
close(watcher)
}
q.meter.Finish()
q.meter.Flush()
q.errorwait.Wait()
}