Skip to content

Commit

Permalink
remove ReadRing in favor of SafeReadRing
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorwhitney committed Oct 21, 2021
1 parent b443179 commit 2553167
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions pkg/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,19 +638,10 @@ func (s *Scheduler) getConnectedFrontendClientsMetric() float64 {
// this is necessary as many callers of this function will only have a valid Scheduler
// reference if the QueryScheduler target has been specified, which is not guaranteed
func (s *Scheduler) SafeReadRing() ring.ReadRing {
if s == nil {
if s == nil || s.ring == nil || !s.cfg.UseSchedulerRing {
return nil
}

return s.ReadRing()
}

// ReadRing returns the scheduler ring as a ReadRing interface,
// it returns nil if UseSchedulerRing == false
func (s *Scheduler) ReadRing() ring.ReadRing {
if s.ring == nil || !s.cfg.UseSchedulerRing {
return nil
}
return s.ring
}

Expand Down

0 comments on commit 2553167

Please sign in to comment.