Skip to content

Commit

Permalink
fix: lint checkerr
Browse files Browse the repository at this point in the history
Signed-off-by: rfyiamcool <[email protected]>
  • Loading branch information
rfyiamcool committed Sep 25, 2023
1 parent 406e3fa commit 51eba9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion elector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 51eba9e

Please sign in to comment.