Skip to content

Commit

Permalink
chore: update client http timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Idil Haq Amir committed Jun 4, 2024
1 parent 9de7876 commit 92e51b3
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions plugins/notifiers/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ type Client interface {
}

const (
ProviderTypeSlack = "slack"
DefaultTimeoutInSeconds = 10
ProviderTypeSlack = "slack"
)

// SlackConfig is a map of workspace name to config
Expand Down Expand Up @@ -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,
}

Expand Down

0 comments on commit 92e51b3

Please sign in to comment.