Skip to content

Commit

Permalink
fix race
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <rleungx@gmail.com>
  • Loading branch information
rleungx committed Nov 23, 2023
1 parent 6b704db commit e08879d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/utils/apiutil/serverapi/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (h *redirector) ServeHTTP(w http.ResponseWriter, r *http.Request, next http
// it is used for testing, to check whether the request is forwarded to the micro service
w.Header().Set(apiutil.ForwardToMicroServiceHeader, "true")
})
} else {
} else if !h.s.IsClosed() {
leader := h.s.GetMember().GetLeader()
if leader == nil {
http.Error(w, "no leader", http.StatusServiceUnavailable)
Expand Down

0 comments on commit e08879d

Please sign in to comment.