aboutsummaryrefslogtreecommitdiffstats
path: root/modules/graceful
diff options
context:
space:
mode:
Diffstat (limited to 'modules/graceful')
-rw-r--r--modules/graceful/server.go6
-rw-r--r--modules/graceful/server_http.go16
2 files changed, 11 insertions, 11 deletions
diff --git a/modules/graceful/server.go b/modules/graceful/server.go
index e7394f349e..c5021a9ba5 100644
--- a/modules/graceful/server.go
+++ b/modules/graceful/server.go
@@ -48,11 +48,11 @@ type Server struct {
}
// NewServer creates a server on network at provided address
-func NewServer(network, address string) *Server {
+func NewServer(network, address, name string) *Server {
if GetManager().IsChild() {
- log.Info("Restarting new server: %s:%s on PID: %d", network, address, os.Getpid())
+ log.Info("Restarting new %s server: %s:%s on PID: %d", name, network, address, os.Getpid())
} else {
- log.Info("Starting new server: %s:%s on PID: %d", network, address, os.Getpid())
+ log.Info("Starting new %s server: %s:%s on PID: %d", name, network, address, os.Getpid())
}
srv := &Server{
wg: sync.WaitGroup{},
diff --git a/modules/graceful/server_http.go b/modules/graceful/server_http.go
index 1052637d5e..b101a10d91 100644
--- a/modules/graceful/server_http.go
+++ b/modules/graceful/server_http.go
@@ -9,8 +9,8 @@ import (
"net/http"
)
-func newHTTPServer(network, address string, handler http.Handler) (*Server, ServeFunction) {
- server := NewServer(network, address)
+func newHTTPServer(network, address, name string, handler http.Handler) (*Server, ServeFunction) {
+ server := NewServer(network, address, name)
httpServer := http.Server{
ReadTimeout: DefaultReadTimeOut,
WriteTimeout: DefaultWriteTimeOut,
@@ -25,21 +25,21 @@ func newHTTPServer(network, address string, handler http.Handler) (*Server, Serv
// HTTPListenAndServe listens on the provided network address and then calls Serve
// to handle requests on incoming connections.
-func HTTPListenAndServe(network, address string, handler http.Handler) error {
- server, lHandler := newHTTPServer(network, address, handler)
+func HTTPListenAndServe(network, address, name string, handler http.Handler) error {
+ server, lHandler := newHTTPServer(network, address, name, handler)
return server.ListenAndServe(lHandler)
}
// HTTPListenAndServeTLS listens on the provided network address and then calls Serve
// to handle requests on incoming connections.
-func HTTPListenAndServeTLS(network, address, certFile, keyFile string, handler http.Handler) error {
- server, lHandler := newHTTPServer(network, address, handler)
+func HTTPListenAndServeTLS(network, address, name, certFile, keyFile string, handler http.Handler) error {
+ server, lHandler := newHTTPServer(network, address, name, handler)
return server.ListenAndServeTLS(certFile, keyFile, lHandler)
}
// HTTPListenAndServeTLSConfig listens on the provided network address and then calls Serve
// to handle requests on incoming connections.
-func HTTPListenAndServeTLSConfig(network, address string, tlsConfig *tls.Config, handler http.Handler) error {
- server, lHandler := newHTTPServer(network, address, handler)
+func HTTPListenAndServeTLSConfig(network, address, name string, tlsConfig *tls.Config, handler http.Handler) error {
+ server, lHandler := newHTTPServer(network, address, name, handler)
return server.ListenAndServeTLSConfig(tlsConfig, lHandler)
}