From 19603ddfc1d959aedd99fc91e5ebde6cdf70dd37 Mon Sep 17 00:00:00 2001 From: Paul Carlton Date: Tue, 24 May 2022 10:03:54 +0100 Subject: [PATCH] Fix panic triggering via HTTP API (#197) Fix GET /panic The GET /panic api call is not working due the the logger.Panic method failing to call panic. This change replaces the logger.Panic method call with logger.Info and adds a call to os.Exit(255). --- pkg/api/panic.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/api/panic.go b/pkg/api/panic.go index 624daee..3ca5fc3 100644 --- a/pkg/api/panic.go +++ b/pkg/api/panic.go @@ -2,6 +2,7 @@ package api import ( "net/http" + "os" ) // Panic godoc @@ -10,5 +11,6 @@ import ( // @Tags HTTP API // @Router /panic [get] func (s *Server) panicHandler(w http.ResponseWriter, r *http.Request) { - s.logger.Panic("Panic command received") + s.logger.Info("Panic command received") + os.Exit(255) }