Fix negative waitgroup error

Signed-off-by: David J. Allen <davidallendj@gmail.com>
This commit is contained in:
David Allen 2023-09-13 11:43:35 -06:00
parent c5a6d2a2be
commit 63a8e2a058

View file

@ -25,6 +25,9 @@ var collectCmd = &cobra.Command{
l.Log.Errorf("could not get states: %v", err) l.Log.Errorf("could not get states: %v", err)
} }
if threads <= 0 {
threads = mathutil.Clamp(len(probeStates), 1, 255)
}
q := &magellan.QueryParams{ q := &magellan.QueryParams{
User: user, User: user,
Pass: pass, Pass: pass,
@ -34,11 +37,6 @@ var collectCmd = &cobra.Command{
Verbose: verbose, Verbose: verbose,
WithSecureTLS: withSecureTLS, WithSecureTLS: withSecureTLS,
} }
// scan and store probe data in dbPath
if threads <= 0 {
threads = mathutil.Clamp(len(probeStates), 1, 255)
}
magellan.CollectInfo(&probeStates, l, q) magellan.CollectInfo(&probeStates, l, q)
// generate custom xnames for bmcs // generate custom xnames for bmcs