mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +00:00
fix webhook timeout bug (#15613)
* Also fix the potential problem in httplib
This commit is contained in:
parent
6ea6e2b4eb
commit
3d5bb3e6a3
2 changed files with 7 additions and 10 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue