From d60cf01c82f43579d3cba60943c32e210cda2fbd Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Thu, 28 Dec 2023 13:30:32 -0500 Subject: [PATCH] fix: ajouter `*http.Client` dans handlers avec bottinApiClient Ajuster selon changement de signature de `bottindata.NewApiClient` --- handlers/health.go | 4 ++++ handlers/transaction.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/handlers/health.go b/handlers/health.go index f193544..1d6d3c5 100644 --- a/handlers/health.go +++ b/handlers/health.go @@ -19,7 +19,11 @@ func GetHealth(c echo.Context) error { bottinApiProtocol := viper.GetString("bottin.api.protocol") bottinApiPort := viper.GetInt("bottin.api.port") + bottinClient := http.DefaultClient + defer bottinClient.CloseIdleConnections() + bottinConnection := bottindata.NewApiClient( + bottinClient, bottinApiKey, bottinApiHost, bottinApiProtocol, diff --git a/handlers/transaction.go b/handlers/transaction.go index c6c6a15..946f6c8 100644 --- a/handlers/transaction.go +++ b/handlers/transaction.go @@ -80,8 +80,12 @@ func PostTransactions(c echo.Context) error { bottinApiProtocol := viper.GetString("bottin.api.protocol") bottinApiPort := viper.GetInt("bottin.api.port") + bottinClient := http.DefaultClient + defer bottinClient.CloseIdleConnections() + // Using bottin's API client bottinApiClient := bottindata.NewApiClient( + bottinClient, bottinApiKey, bottinApiHost, bottinApiProtocol,