From 658763e8a87a33e40dc0da8413853a4bf6135946 Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Thu, 28 Dec 2023 13:36:40 -0500 Subject: [PATCH] =?UTF-8?q?fix(apicmd):=20ajouter=20`*http.Client`=20?= =?UTF-8?q?=C3=A0=20`apiCmd`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/api.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/api.go b/cmd/api.go index 2aa156b..5f11779 100644 --- a/cmd/api.go +++ b/cmd/api.go @@ -4,6 +4,7 @@ import ( "crypto/subtle" "fmt" "log" + "net/http" "git.agecem.com/agecem/bottin-agenda/data" "git.agecem.com/agecem/bottin-agenda/handlers" @@ -34,8 +35,12 @@ var apiCmd = &cobra.Command{ bottinApiProtocol := viper.GetString("bottin.api.protocol") bottinApiPort := viper.GetInt("bottin.api.port") + bottinClient := http.DefaultClient + defer bottinClient.CloseIdleConnections() + // Using bottin's API client bottinConnection := bottindata.NewApiClient( + bottinClient, bottinApiKey, bottinApiHost, bottinApiProtocol,