Skip to content

Commit 31922d5

Browse files
committed
Add timeout to go-pagerduty's http client
1 parent af562ea commit 31922d5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pagerdutyplugin/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"os"
99
"path/filepath"
1010
"sync"
11+
"time"
1112

1213
"github.com/PagerDuty/go-pagerduty"
1314
"github.com/hashicorp/terraform-plugin-framework/diag"
@@ -71,6 +72,7 @@ func (c *Config) Client(ctx context.Context) (*pagerduty.Client, error) {
7172
}
7273

7374
httpClient := http.DefaultClient
75+
httpClient.Timeout = 1 * time.Minute
7476
httpClient.Transport = logging.NewTransport("PagerDuty", http.DefaultTransport)
7577

7678
apiUrl := c.ApiUrl

0 commit comments

Comments
 (0)