Skip to content

Commit

Permalink
Retry reads in Cloud SQL Database Instance
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
rileykarson authored and modular-magician committed Apr 3, 2019
1 parent a95829d commit f4a5ed8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions google/resource_sql_database_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,13 @@ func resourceSqlDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) e
return err
}

instance, err := config.clientSqlAdmin.Instances.Get(project,
d.Id()).Do()
var instance *sqladmin.DatabaseInstance
err = retry(
func() error {
instance, err = config.clientSqlAdmin.Instances.Get(project, d.Id()).Do()
return err
},
)

if err != nil {
return handleNotFoundError(err, d, fmt.Sprintf("SQL Database Instance %q", d.Get("name").(string)))
Expand Down

0 comments on commit f4a5ed8

Please sign in to comment.