Added function debugWait to support attaching a debugger
package azuredevops
import (
+ "os"
+ "time"
+
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-azuredevops/azuredevops/internal/client"
"github.com/terraform-providers/terraform-provider-azuredevops/azuredevops/internal/service"
@@ -84,3 +87,13 @@ func providerConfigure(p *schema.Provider) schema.ConfigureFunc {
return client, err
}
}
+
+var debugWaitPassed = false
+
+func debugWait(force ...bool) {
+ bForce := force != nil && force[0]
+ if (!debugWaitPassed || bForce) && "1" == os.Getenv("AZDO_PROVIDER_DEBUG") {
+ time.Sleep(20 * time.Second)
+ debugWaitPassed = true
+ }
+}
