MCPcopy Create free account
hub / github.com/cortexproject/cortex / IsReady

Method IsReady

pkg/ring/model.go:153–161  ·  view source on GitHub ↗

IsReady returns no error if the instance is ACTIVE and healthy.

(storageLastUpdated time.Time, heartbeatTimeout time.Duration)

Source from the content-addressed store, hash-verified

151
152// IsReady returns no error if the instance is ACTIVE and healthy.
153func (i *InstanceDesc) IsReady(storageLastUpdated time.Time, heartbeatTimeout time.Duration) error {
154 if !i.IsHeartbeatHealthy(heartbeatTimeout, storageLastUpdated) {
155 return fmt.Errorf("instance %s past heartbeat timeout", i.Addr)
156 }
157 if i.State != ACTIVE && i.State != READONLY {
158 return fmt.Errorf("instance %s in state %v", i.Addr, i.State)
159 }
160 return nil
161}
162
163func HasInstanceDescsChanged(beforeByID, afterByID map[string]InstanceDesc, hasChanged func(b, a InstanceDesc) bool) bool {
164 if len(beforeByID) != len(afterByID) {

Callers

nothing calls this directly

Calls 1

IsHeartbeatHealthyMethod · 0.95

Tested by

no test coverage detected