mirror of
https://github.com/datarhei/core.git
synced 2025-10-05 16:07:07 +08:00
If leave fails, shutdown cluster anyways
This commit is contained in:
@@ -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")
|
||||||
|
Reference in New Issue
Block a user