Skip to content

Commit 9519a66

Browse files
author
Shlomi Noach
committed
added courtesy-reminder
1 parent 583d6d3 commit 9519a66

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

go/logic/migrator.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,21 @@ func (this *Migrator) printStatus() {
578578
if rowsEstimate > 0 {
579579
progressPct = 100.0 * float64(totalRowsCopied) / float64(rowsEstimate)
580580
}
581-
var etaSeconds float64 = math.MaxFloat64
582581

582+
// Before status, let's see if we should print a nice reminder for what exactly we're doing here.
583+
shouldPrintCourtesyReminder := (elapsedSeconds%120 == 0)
584+
if shouldPrintCourtesyReminder {
585+
courtesyReminder := fmt.Sprintf("# Migrating %s.%s; Ghost table is %s.%s; migration started at %+v",
586+
sql.EscapeName(this.migrationContext.DatabaseName),
587+
sql.EscapeName(this.migrationContext.OriginalTableName),
588+
sql.EscapeName(this.migrationContext.DatabaseName),
589+
sql.EscapeName(this.migrationContext.GetGhostTableName()),
590+
this.migrationContext.StartTime.Format(time.RubyDate),
591+
)
592+
fmt.Println(courtesyReminder)
593+
}
594+
595+
var etaSeconds float64 = math.MaxFloat64
583596
eta := "N/A"
584597
if isThrottled, throttleReason := this.migrationContext.IsThrottled(); isThrottled {
585598
eta = fmt.Sprintf("throttled, %s", throttleReason)

0 commit comments

Comments
 (0)