From 6b2a2f6bc782e4c8d9da84c5332d0b00029960f6 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Fri, 7 Mar 2025 13:31:17 -0900 Subject: [PATCH] test --- web/server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/server.go b/web/server.go index 2eef970..604305e 100644 --- a/web/server.go +++ b/web/server.go @@ -462,6 +462,7 @@ func (s *Server) handleEvents() http.HandlerFunc { // handleAdminEvents handles SSE events func (s *Server) handleAdminEvents() http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { + s.logger.Info("Admin events SSE connection established") // Set headers for SSE w.Header().Set("Content-Type", "text/event-stream") w.Header().Set("Cache-Control", "no-cache") @@ -475,15 +476,17 @@ func (s *Server) handleAdminEvents() http.HandlerFunc { http.Error(w, "Streaming unsupported!", http.StatusInternalServerError) return } + s.logger.Info("Admin events SSE headers flushed") // Create a channel for this client clientChan := make(chan string, 10) - + s.logger.Info("Admin events SSE client channel created") // Add client to map with mutex protection s.adminclientsMux.Lock() s.adminclients[clientChan] = true clientCount := len(s.adminclients) s.adminclientsMux.Unlock() + s.logger.Info("Admin events SSE client added to map") s.logger.Info("New client connected", "clientIP", r.RemoteAddr,