From 78f47be75fbed117668ed2d602f3aefa37a80450 Mon Sep 17 00:00:00 2001 From: Alexander Danylenko Date: Wed, 27 Mar 2024 16:03:35 +0200 Subject: [PATCH] feat: Increase timeouts --- internal/provider/provider.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index cb8944b..83332db 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -3,6 +3,7 @@ package provider import ( "context" "os" + "time" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/function" @@ -119,7 +120,12 @@ func (p *TypesenseProvider) Configure(ctx context.Context, req provider.Configur // Create a new typesense client using the configuration values client := typesense.NewClient( typesense.WithServer(api_address), - typesense.WithAPIKey(api_key)) + typesense.WithAPIKey(api_key), + typesense.WithConnectionTimeout(5*time.Minute), + typesense.WithConnectionTimeout(5*time.Second), + typesense.WithCircuitBreakerMaxRequests(50), + typesense.WithCircuitBreakerInterval(2*time.Minute), + typesense.WithCircuitBreakerTimeout(1*time.Minute)) // Make the Typesense client available during DataSource and Resource // type Configure methods.