Skip to content

Commit 92e51b3

Browse files
author
Muhammad Idil Haq Amir
committed
chore: update client http timeout
1 parent 9de7876 commit 92e51b3

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

plugins/notifiers/client.go

+2-8
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ type Client interface {
2020
}
2121

2222
const (
23-
ProviderTypeSlack = "slack"
24-
DefaultTimeoutInSeconds = 10
23+
ProviderTypeSlack = "slack"
2524
)
2625

2726
// SlackConfig is a map of workspace name to config
@@ -51,17 +50,12 @@ func NewClient(config *Config, logger log.Logger) (Client, error) {
5150
return nil, err
5251
}
5352

54-
timeout := DefaultTimeoutInSeconds
55-
if config.TimeoutInSeconds > 0 {
56-
timeout = config.TimeoutInSeconds
57-
}
58-
5953
retryableTransport := &retryablehttp.RetryableTransport{
6054
Transport: &http.Transport{},
6155
RetryCount: config.MaxRetryCount,
6256
}
6357
httpClient := &http.Client{
64-
Timeout: time.Duration(timeout) * time.Second,
58+
Timeout: time.Duration(config.TimeoutInSeconds) * time.Second,
6559
Transport: retryableTransport,
6660
}
6761

0 commit comments

Comments
 (0)