diff --git a/plugin/scheduler_example/evict_leader.go b/plugin/scheduler_example/evict_leader.go index 12e1417594d..7164f36b1bb 100644 --- a/plugin/scheduler_example/evict_leader.go +++ b/plugin/scheduler_example/evict_leader.go @@ -276,7 +276,7 @@ func (handler *evictLeaderHandler) updateConfig(w http.ResponseWriter, r *http.R err := handler.config.BuildWithArgs(args) if err != nil { handler.config.mu.Lock() - handler.config.cluster.ResumeLeaderTransfer(id) + handler.config.cluster.ResumeLeaderTransfer(id, constant.In) handler.config.mu.Unlock() handler.rd.JSON(w, http.StatusBadRequest, err.Error()) return @@ -285,7 +285,7 @@ func (handler *evictLeaderHandler) updateConfig(w http.ResponseWriter, r *http.R if err != nil { handler.config.mu.Lock() delete(handler.config.StoreIDWitRanges, id) - handler.config.cluster.ResumeLeaderTransfer(id) + handler.config.cluster.ResumeLeaderTransfer(id, constant.In) handler.config.mu.Unlock() handler.rd.JSON(w, http.StatusInternalServerError, err.Error()) return @@ -318,7 +318,7 @@ func (handler *evictLeaderHandler) deleteConfig(w http.ResponseWriter, r *http.R if err := handler.config.Persist(); err != nil { handler.config.StoreIDWitRanges[id] = ranges - _ = handler.config.cluster.PauseLeaderTransfer(id) + _ = handler.config.cluster.PauseLeaderTransfer(id, constant.In) handler.rd.JSON(w, http.StatusInternalServerError, err.Error()) return }