Fix integer divide by zero panic in migrator

This commit is contained in:
Tim Vaillancourt 2022-06-23 03:37:18 +02:00
parent ed46138c06
commit de339dd042

View File

@ -1006,7 +1006,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)
}
}