@marcel91200 / caddy Mirror · read-only / commits / 83551edf
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

cmd: Only stop admin server on signal if it exists (fix #3470)

Matthew Holt committed Jun 3, 2020 at 07:31 UTC 83551edf3e050b5dd094fc1cff20a3f78c4d621f
1 file changed +8 -6
sigtrap.go
+8 -6
@@ -69,12 +69,14 @@ func gracefulStop(sigName string) {
69 exitCode = ExitCodeFailedQuit
70 }
71
72 - err = stopAdminServer(adminServer)
73 - if err != nil {
74 - Log().Error("stopping admin endpoint",
75 - zap.String("signal", sigName),
76 - zap.Error(err))
77 - exitCode = ExitCodeFailedQuit
72 + if adminServer != nil {
73 + err = stopAdminServer(adminServer)
74 + if err != nil {
75 + Log().Error("stopping admin endpoint",
76 + zap.String("signal", sigName),
77 + zap.Error(err))
78 + exitCode = ExitCodeFailedQuit
79 + }
80 }
81 }
82