From de339dd042b239f262fe7e2e1efd6d5143ebd75a Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Thu, 23 Jun 2022 03:37:18 +0200 Subject: [PATCH] Fix `integer divide by zero` panic in migrator --- go/logic/migrator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go/logic/migrator.go b/go/logic/migrator.go index c5cb24432..b5c405a98 100644 --- a/go/logic/migrator.go +++ b/go/logic/migrator.go @@ -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) } }