Skip to content

Commit

Permalink
databases: Fix custom create timeouts. (#987)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsomething authored May 2, 2023
1 parent 7b1fb28 commit b9d7df0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions digitalocean/database/resource_database_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ func resourceDigitalOceanDatabaseClusterDelete(ctx context.Context, d *schema.Re
func waitForDatabaseCluster(client *godo.Client, d *schema.ResourceData, status string) (*godo.Database, error) {
var (
tickerInterval = 15 * time.Second
timeoutSeconds = d.Timeout(schema.TimeoutDelete).Seconds()
timeoutSeconds = d.Timeout(schema.TimeoutCreate).Seconds()
timeout = int(timeoutSeconds / tickerInterval.Seconds())
n = 0
ticker = time.NewTicker(tickerInterval)
Expand All @@ -543,7 +543,7 @@ func waitForDatabaseCluster(client *godo.Client, d *schema.ResourceData, status
return database, nil
}

if n > timeout {
if n >= timeout {
ticker.Stop()
break
}
Expand Down

0 comments on commit b9d7df0

Please sign in to comment.