From 0c079f9cfc92c22593a5f4aeabf6a93fb9fbe8e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Pavl=C3=AD=C4=8Dek?= Date: Tue, 27 Jan 2026 14:23:22 +0100 Subject: [PATCH] disable keep-alive connections for REST API http client --- src/zeropsRestApiClient/handler.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/zeropsRestApiClient/handler.go b/src/zeropsRestApiClient/handler.go index 388e9d54..78649f3a 100644 --- a/src/zeropsRestApiClient/handler.go +++ b/src/zeropsRestApiClient/handler.go @@ -16,9 +16,15 @@ type Handler struct { func NewAuthorizedClient(token string, regionUrl string) *Handler { config := sdkBase.DefaultConfig(sdkBase.WithCustomEndpoint(regionUrl)) + httpClient := &http.Client{ + Transport: &http.Transport{ + DisableKeepAlives: true, + }, + } + return &Handler{ - Handler: sdk.AuthorizeSdk(sdk.New(config, http.DefaultClient), token), + Handler: sdk.AuthorizeSdk(sdk.New(config, httpClient), token), // temporary solution, I need my own endpoints - env: sdkBase.NewEnvironment(config, http.DefaultClient).Authorize(token), + env: sdkBase.NewEnvironment(config, httpClient).Authorize(token), } }