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() { func (c *uploadContext) ReportErrors() {
c.meter.Finish()
for _, err := range c.otherErrs { for _, err := range c.otherErrs {
FullError(err) FullError(err)
} }

@ -163,6 +163,15 @@ func (m *Meter) FinishTransfer(name string) {
m.fileIndexMutex.Unlock() 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. // Finish shuts down the Meter.
func (m *Meter) Finish() { func (m *Meter) Finish() {
if m == nil { if m == nil {

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