mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Added checks for access token when running command
This commit is contained in:
parent
7760857ae5
commit
09c5af44b9
3 changed files with 38 additions and 10 deletions
|
|
@ -27,6 +27,16 @@ var collectCmd = &cobra.Command{
|
|||
l.Log.Errorf("could not get states: %v", err)
|
||||
}
|
||||
|
||||
// try to load access token either from env var, file, or config if var not set
|
||||
if accessToken == "" {
|
||||
var err error
|
||||
accessToken, err = LoadAccessToken()
|
||||
if err != nil {
|
||||
l.Log.Errorf("failed to load access token: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if threads <= 0 {
|
||||
threads = mathutil.Clamp(len(probeStates), 1, 255)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue