If leave fails, shutdown cluster anyways

This commit is contained in:
Ingo Oppermann
2023-06-06 11:25:02 +02:00
parent 1f6f7c9f59
commit cefc03bcb2

View File

@@ -96,11 +96,7 @@ func (h *ClusterHandler) About(c echo.Context) error {
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Router /api/v3/cluster/leave [put] // @Router /api/v3/cluster/leave [put]
func (h *ClusterHandler) Leave(c echo.Context) error { func (h *ClusterHandler) Leave(c echo.Context) error {
err := h.cluster.Leave("", "") h.cluster.Leave("", "")
if err != nil {
return api.Err(http.StatusInternalServerError, "", "Failed to leave cluster gracefully: %s", err)
}
h.cluster.Shutdown() h.cluster.Shutdown()
return c.JSON(http.StatusOK, "OK") return c.JSON(http.StatusOK, "OK")