Skip to content

Commit

Permalink
Set API timeout from ENV when credentials are specified in ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
kobajagi committed Aug 2, 2024
1 parent 3852047 commit ac878ae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ func initConfig() { //nolint:gocyclo
account.CurrentAccount.SosEndpoint = sosEndpointFromEnv
}

clientTimeoutFromEnv := readFromEnv("EXOSCALE_API_TIMEOUT")
if clientTimeoutFromEnv != "" {
if t, err := strconv.Atoi(clientTimeoutFromEnv); err == nil {
account.CurrentAccount.ClientTimeout = t
}
}

account.GAllAccount = &account.Config{
DefaultAccount: account.CurrentAccount.Name,
Accounts: []account.Account{*account.CurrentAccount},
Expand Down

0 comments on commit ac878ae

Please sign in to comment.