summaryrefslogtreecommitdiffstats
path: root/modules/graceful
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-05-31 07:18:11 +0100
committerGitHub <noreply@github.com>2021-05-31 02:18:11 -0400
commit3183a465d71a13535e52589bb85b987176872fcd (patch)
tree03d1cb88627176f35e168cda5e46df197dcc3110 /modules/graceful
parent518ed504ef8714eeac126fc59ff57f50a98e3692 (diff)
downloadgitea-3183a465d71a13535e52589bb85b987176872fcd.tar.gz
gitea-3183a465d71a13535e52589bb85b987176872fcd.zip
Make modules/context.Context a context.Context (#16031)
* Make modules/context.Context a context.Context Signed-off-by: Andrew Thornton <art27@cantab.net> * Simplify context calls Signed-off-by: Andrew Thornton <art27@cantab.net> * Set the base context for requests to the HammerContext Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/graceful')
-rw-r--r--modules/graceful/server_http.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/graceful/server_http.go b/modules/graceful/server_http.go
index b101a10d91..4471e379ef 100644
--- a/modules/graceful/server_http.go
+++ b/modules/graceful/server_http.go
@@ -5,7 +5,9 @@
package graceful
import (
+ "context"
"crypto/tls"
+ "net"
"net/http"
)
@@ -16,6 +18,7 @@ func newHTTPServer(network, address, name string, handler http.Handler) (*Server
WriteTimeout: DefaultWriteTimeOut,
MaxHeaderBytes: DefaultMaxHeaderBytes,
Handler: handler,
+ BaseContext: func(net.Listener) context.Context { return GetManager().HammerContext() },
}
server.OnShutdown = func() {
httpServer.SetKeepAlivesEnabled(false)