From 346e8ae2b594798c52f7055b26b6575799b07cca Mon Sep 17 00:00:00 2001 From: Shuhao Wu Date: Mon, 5 Oct 2020 17:21:06 +0000 Subject: [PATCH] Min reporting frequency? do not merge yet :P --- ferry.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ferry.go b/ferry.go index 79626787d..72be5e2cc 100644 --- a/ferry.go +++ b/ferry.go @@ -36,6 +36,7 @@ const ( StateVerifyBeforeCutover = "verify-before-cutover" StateCutover = "cutover" StateDone = "done" + minReportFrequency = 1 * time.Minute ) func quoteField(field string) string { @@ -575,6 +576,9 @@ func (f *Ferry) Run() { defer supportingServicesWg.Done() frequency := time.Duration(f.Config.ProgressReportFrequency) * time.Millisecond + if frequency < minReportFrequency { + frequency = minReportFrequency + } for { select { @@ -593,6 +597,9 @@ func (f *Ferry) Run() { defer supportingServicesWg.Done() frequency := time.Duration(f.Config.StateReportFrequency) * time.Millisecond + if frequency < minReportFrequency { + frequency = minReportFrequency + } for { select {