progress is 100% when 0/0 rows copied

This commit is contained in:
Shlomi Noach 2016-08-18 13:20:09 +02:00
parent d9ae2f3942
commit 7e9f578e12

View File

@ -941,7 +941,9 @@ func (this *Migrator) printStatus(rule PrintStatusRule, writers ...io.Writer) {
totalRowsCopied := this.migrationContext.GetTotalRowsCopied()
rowsEstimate := atomic.LoadInt64(&this.migrationContext.RowsEstimate)
var progressPct float64
if rowsEstimate > 0 {
if rowsEstimate == 0 {
progressPct = 100.0
} else {
progressPct = 100.0 * float64(totalRowsCopied) / float64(rowsEstimate)
}