From b9d7df09b3100bda998db173aba2fa9bf3ee3e57 Mon Sep 17 00:00:00 2001 From: Andrew Starr-Bochicchio Date: Tue, 2 May 2023 16:21:25 -0400 Subject: [PATCH] databases: Fix custom create timeouts. (#987) --- digitalocean/database/resource_database_cluster.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/digitalocean/database/resource_database_cluster.go b/digitalocean/database/resource_database_cluster.go index 2cba49d86..9c0eeed08 100644 --- a/digitalocean/database/resource_database_cluster.go +++ b/digitalocean/database/resource_database_cluster.go @@ -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) @@ -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 }