diff --git a/commands/uploader.go b/commands/uploader.go index 5d240438..e7c25c05 100644 --- a/commands/uploader.go +++ b/commands/uploader.go @@ -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) } diff --git a/tq/meter.go b/tq/meter.go index cb7f2f9d..57c27772 100644 --- a/tq/meter.go +++ b/tq/meter.go @@ -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 { diff --git a/tq/transfer_queue.go b/tq/transfer_queue.go index cdc2dc2a..fe3daf69 100644 --- a/tq/transfer_queue.go +++ b/tq/transfer_queue.go @@ -768,7 +768,7 @@ func (q *TransferQueue) Wait() { close(watcher) } - q.meter.Finish() + q.meter.Flush() q.errorwait.Wait() }