mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
fix webhook timeout bug (#15613)
* Also fix the potential problem in httplib
This commit is contained in:
@ -271,14 +271,10 @@ func InitDeliverHooks() {
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: setting.Webhook.SkipTLSVerify},
|
||||
Proxy: webhookProxy(),
|
||||
Dial: func(netw, addr string) (net.Conn, error) {
|
||||
conn, err := net.DialTimeout(netw, addr, timeout)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return conn, conn.SetDeadline(time.Now().Add(timeout))
|
||||
return net.DialTimeout(netw, addr, timeout) // dial timeout
|
||||
},
|
||||
},
|
||||
Timeout: timeout, // request timeout
|
||||
}
|
||||
|
||||
go graceful.GetManager().RunWithShutdownContext(DeliverHooks)
|
||||
|
Reference in New Issue
Block a user