@@ -26,11 +26,15 @@ var (
2626)
2727
2828type GitHubOptions struct {
29- AppID interface {} `json:"appID"`
30- InstallationID interface {} `json:"installationID"`
31- PrivateKey string `json:"privateKey"`
32- EnterpriseBaseURL string `json:"enterpriseBaseURL"`
33- Transport httputil.HTTPTransportSettings `json:"transport"`
29+ AppID interface {} `json:"appID"`
30+ InstallationID interface {} `json:"installationID"`
31+ PrivateKey string `json:"privateKey"`
32+ EnterpriseBaseURL string `json:"enterpriseBaseURL"`
33+ InsecureSkipVerify bool `json:"insecureSkipVerify"`
34+ MaxIdleConns int `json:"maxIdleConns"`
35+ MaxIdleConnsPerHost int `json:"maxIdleConnsPerHost"`
36+ MaxConnsPerHost int `json:"maxConnsPerHost"`
37+ IdleConnTimeout time.Duration `json:"idleConnTimeout"`
3438}
3539
3640type GitHubNotification struct {
@@ -382,7 +386,6 @@ func (g *GitHubNotification) GetTemplater(name string, f texttemplate.FuncMap) (
382386
383387func NewGitHubService (opts GitHubOptions ) (* gitHubService , error ) {
384388 url := "https://api.github.com"
385- opts .Transport .InsecureSkipVerify = false
386389 if opts .EnterpriseBaseURL != "" {
387390 url = opts .EnterpriseBaseURL
388391 }
@@ -398,7 +401,7 @@ func NewGitHubService(opts GitHubOptions) (*gitHubService, error) {
398401 }
399402
400403 tr := httputil .NewLoggingRoundTripper (
401- httputil .NewTransport (url , opts .Transport ), log .WithField ("service" , "github" ))
404+ httputil .NewTransport (url , opts .MaxIdleConns , opts . MaxIdleConnsPerHost , opts . MaxConnsPerHost , opts . IdleConnTimeout , false ), log .WithField ("service" , "github" ))
402405 itr , err := ghinstallation .New (tr , appID , installationID , []byte (opts .PrivateKey ))
403406 if err != nil {
404407 return nil , err
0 commit comments