diff --git a/internal/server/handlers/msg.go b/internal/server/handlers/msg.go index 3b8a68d..447b41f 100644 --- a/internal/server/handlers/msg.go +++ b/internal/server/handlers/msg.go @@ -90,6 +90,7 @@ func PopMsg(w http.ResponseWriter, r *http.Request) { if q.IsEmpty() { response.Send(w, http.StatusNotFound, response.Error{Error: "empty_queue", Info: "The queue is empty"}) + q.Mu.Unlock() return } msg := q.Pop()