From 63a8e2a058cadd9b6e0e568935b408886cd7a84b Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Wed, 13 Sep 2023 11:43:35 -0600 Subject: [PATCH] Fix negative waitgroup error Signed-off-by: David J. Allen --- cmd/collect.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/collect.go b/cmd/collect.go index 2a7d0d4..bc58293 100644 --- a/cmd/collect.go +++ b/cmd/collect.go @@ -25,6 +25,9 @@ var collectCmd = &cobra.Command{ l.Log.Errorf("could not get states: %v", err) } + if threads <= 0 { + threads = mathutil.Clamp(len(probeStates), 1, 255) + } q := &magellan.QueryParams{ User: user, Pass: pass, @@ -34,11 +37,6 @@ var collectCmd = &cobra.Command{ Verbose: verbose, WithSecureTLS: withSecureTLS, } - - // scan and store probe data in dbPath - if threads <= 0 { - threads = mathutil.Clamp(len(probeStates), 1, 255) - } magellan.CollectInfo(&probeStates, l, q) // generate custom xnames for bmcs