Skip to content

Commit

Permalink
make provider timeout configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyriakos Oikonomakos committed May 10, 2021
1 parent 1248161 commit 6b33490
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vsphere/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

// defaultAPITimeout is a default timeout value that is passed to functions
// requiring contexts, and other various waiters.
const defaultAPITimeout = time.Minute * 5
var defaultAPITimeout time.Duration = time.Minute * 5

// Provider returns a terraform.ResourceProvider.
func Provider() *schema.Provider {
Expand Down Expand Up @@ -171,6 +171,9 @@ func Provider() *schema.Provider {
}

func providerConfigure(d *schema.ResourceData) (interface{}, error) {
timeoutMins := time.Duration(d.Get("api_timeout").(int))
defaultAPITimeout = time.Duration(timeoutMins * time.Minute)

c, err := NewConfig(d)
if err != nil {
return nil, err
Expand Down

0 comments on commit 6b33490

Please # to comment.