diff --git a/Makefile b/Makefile index 81a8a69..d6f18df 100644 --- a/Makefile +++ b/Makefile @@ -9,4 +9,4 @@ lint: @golangci-lint run test: - @go test -race -v $(GO_FLAGS) -count=1 $(GO_PKGS) + @go test -v $(GO_FLAGS) -count=1 $(GO_PKGS) diff --git a/elector.go b/elector.go index 339c7fc..79ee7e0 100644 --- a/elector.go +++ b/elector.go @@ -186,7 +186,7 @@ func (e *Elector) Start(electionPath string) error { continue } - if !e.isLeader { + if e.IsLeader(e.ctx) != nil { // is non-leader e.setLeader(val) e.logger("switch to leader, the current instance is leader") }