From 92e51b3845413c06a858b5632b34e22cba58ee1e Mon Sep 17 00:00:00 2001 From: Muhammad Idil Haq Amir Date: Mon, 1 Apr 2024 15:55:08 +0700 Subject: [PATCH] chore: update client http timeout --- plugins/notifiers/client.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/plugins/notifiers/client.go b/plugins/notifiers/client.go index 899f39622..4d0fa9a8d 100644 --- a/plugins/notifiers/client.go +++ b/plugins/notifiers/client.go @@ -20,8 +20,7 @@ type Client interface { } const ( - ProviderTypeSlack = "slack" - DefaultTimeoutInSeconds = 10 + ProviderTypeSlack = "slack" ) // SlackConfig is a map of workspace name to config @@ -51,17 +50,12 @@ func NewClient(config *Config, logger log.Logger) (Client, error) { return nil, err } - timeout := DefaultTimeoutInSeconds - if config.TimeoutInSeconds > 0 { - timeout = config.TimeoutInSeconds - } - retryableTransport := &retryablehttp.RetryableTransport{ Transport: &http.Transport{}, RetryCount: config.MaxRetryCount, } httpClient := &http.Client{ - Timeout: time.Duration(timeout) * time.Second, + Timeout: time.Duration(config.TimeoutInSeconds) * time.Second, Transport: retryableTransport, }