File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ func (s *Server) startUnixSocketServer(ctx context.Context) {
144144 }
145145
146146 // Start a http server for monitoring if monitoringport is configured
147- if s .monitoringEcho != nil && s . config . GetMonitoringPort ( s . zapLog ) > 0 {
147+ if s .isMonitoringPortConfigured () {
148148 go s .startMonitoringServer ()
149149 defer func () { _ = s .monitoringEcho .Close () }()
150150 }
@@ -176,7 +176,7 @@ func (s *Server) startUnixSocketServer(ctx context.Context) {
176176// startAsHTTPServer launch the API server
177177func (s * Server ) startAsHTTPServer () {
178178 // starting the monitoring server on a different port if configured
179- if s .monitoringEcho != nil {
179+ if s .isMonitoringPortConfigured () {
180180 go s .startMonitoringServer ()
181181 defer func () { _ = s .monitoringEcho .Close () }()
182182 }
@@ -238,3 +238,8 @@ func (s *Server) Stop(ctx context.Context) {
238238 }
239239 }
240240}
241+
242+ // isMonitoringPortConfigured checks if the monitoring port is configured.
243+ func (s * Server ) isMonitoringPortConfigured () bool {
244+ return s .monitoringEcho != nil && s .config .GetMonitoringPort (s .zapLog ) > 0
245+ }
You can’t perform that action at this time.
0 commit comments