Skip to content

Commit 36a2863

Browse files
author
Shlomi Noach
authored
Merge pull request #177 from github/interactive-sup-fix
fixed sup printing heuristic
2 parents 61c7e18 + d8e30fc commit 36a2863

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

go/logic/migrator.go

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -986,20 +986,22 @@ func (this *Migrator) printStatus(rule PrintStatusRule, writers ...io.Writer) {
986986
}
987987

988988
shouldPrintStatus := false
989-
if elapsedSeconds <= 60 {
990-
shouldPrintStatus = true
991-
} else if etaSeconds <= 60 {
992-
shouldPrintStatus = true
993-
} else if etaSeconds <= 180 {
994-
shouldPrintStatus = (elapsedSeconds%5 == 0)
995-
} else if elapsedSeconds <= 180 {
996-
shouldPrintStatus = (elapsedSeconds%5 == 0)
997-
} else if this.migrationContext.TimeSincePointOfInterest().Seconds() <= 60 {
998-
shouldPrintStatus = (elapsedSeconds%5 == 0)
989+
if rule == HeuristicPrintStatusRule {
990+
if elapsedSeconds <= 60 {
991+
shouldPrintStatus = true
992+
} else if etaSeconds <= 60 {
993+
shouldPrintStatus = true
994+
} else if etaSeconds <= 180 {
995+
shouldPrintStatus = (elapsedSeconds%5 == 0)
996+
} else if elapsedSeconds <= 180 {
997+
shouldPrintStatus = (elapsedSeconds%5 == 0)
998+
} else if this.migrationContext.TimeSincePointOfInterest().Seconds() <= 60 {
999+
shouldPrintStatus = (elapsedSeconds%5 == 0)
1000+
} else {
1001+
shouldPrintStatus = (elapsedSeconds%30 == 0)
1002+
}
9991003
} else {
1000-
shouldPrintStatus = (elapsedSeconds%30 == 0)
1001-
}
1002-
if rule == ForcePrintStatusRule || rule == ForcePrintStatusAndHintRule {
1004+
// Not heuristic
10031005
shouldPrintStatus = true
10041006
}
10051007
if !shouldPrintStatus {

0 commit comments

Comments
 (0)