Merge pull request #1140 from timvaillancourt/fix-issue-1117

Fix `integer divide by zero` panic in migrator
This commit is contained in:
dm-2 2022-07-06 17:11:16 +01:00 committed by GitHub
commit 3901a86422
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1009,7 +1009,8 @@ func (this *Migrator) printStatus(rule PrintStatusRule, writers ...io.Writer) {
w := io.MultiWriter(writers...)
fmt.Fprintln(w, status)
if elapsedSeconds%this.migrationContext.HooksStatusIntervalSec == 0 {
hooksStatusIntervalSec := this.migrationContext.HooksStatusIntervalSec
if hooksStatusIntervalSec > 0 && elapsedSeconds%hooksStatusIntervalSec == 0 {
this.hooksExecutor.onStatus(status)
}
}