mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-08-19 20:26:38 +00:00
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).
This commit is contained in:
+3
-1
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user