fix #2733: trying to fix CI race
parent
a235b4998d
commit
5f49934a23
|
@ -365,7 +365,11 @@ func (s *Store) Ready() <-chan struct{} { return s.ready }
|
||||||
func (s *Store) Err() <-chan error { return s.err }
|
func (s *Store) Err() <-chan error { return s.err }
|
||||||
|
|
||||||
// IsLeader returns true if the store is currently the leader.
|
// IsLeader returns true if the store is currently the leader.
|
||||||
func (s *Store) IsLeader() bool { return s.raft.State() == raft.Leader }
|
func (s *Store) IsLeader() bool {
|
||||||
|
s.mu.RLock()
|
||||||
|
defer s.mu.RUnlock()
|
||||||
|
return s.raft.State() == raft.Leader
|
||||||
|
}
|
||||||
|
|
||||||
// LeaderCh returns a channel that notifies on leadership change.
|
// LeaderCh returns a channel that notifies on leadership change.
|
||||||
// Panics when the store has not been opened yet.
|
// Panics when the store has not been opened yet.
|
||||||
|
|
Loading…
Reference in New Issue