Skip to content

Commit

Permalink
Don't panic.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwecan committed Nov 3, 2023
1 parent 9fa5abd commit de94069
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions sdk/helper/nomad/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,10 @@ func ConfigFromNamespacedMap(cfg map[string]string) *api.Config {
if httpAuth, ok := cfg[configKeyNomadHTTPAuth]; ok {
c.HttpAuth = HTTPAuthFromString(httpAuth)
}

// We may ignore errors from ParseDuration() here as the provided argument
// has already passed general validation as part of being a DurationVar flag.
if blockQueryWaitTimeDuration, ok := cfg[configKeyNomadWaitTime]; ok {
blockQueryWaitTimeDuration, err := time.ParseDuration(blockQueryWaitTimeDuration)
if err != nil {
panic(err)
}
blockQueryWaitTimeDuration, _ := time.ParseDuration(blockQueryWaitTimeDuration)
c.WaitTime = blockQueryWaitTimeDuration
}

Expand Down

0 comments on commit de94069

Please sign in to comment.