providers/azurerm: timeout storage account for an hour

This commit is contained in:
Mitchell Hashimoto 2016-08-16 09:26:33 -07:00
parent ccb972ae50
commit 284725fa94
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 4 additions and 0 deletions

View File

@ -143,6 +143,10 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e
// since we will likely also want to introduce a time-based timeout. // since we will likely also want to introduce a time-based timeout.
var createErr error var createErr error
select { select {
case <-time.After(1 * time.Hour):
// An hour is way above the expected P99 for this API call so
// we premature cancel and error here.
createErr = wrap.Cancel()
case createErr = <-wrap.ErrCh: case createErr = <-wrap.ErrCh:
// Successfully ran (but perhaps not successfully completed) // Successfully ran (but perhaps not successfully completed)
// the function. // the function.