MCPcopy
hub / github.com/grafana/dskit / GetReadOnlyState

Method GetReadOnlyState

ring/model.go:163–174  ·  view source on GitHub ↗

GetReadOnlyState returns the read-only state and timestamp of last read-only state update.

()

Source from the content-addressed store, hash-verified

161
162// GetReadOnlyState returns the read-only state and timestamp of last read-only state update.
163func (i *InstanceDesc) GetReadOnlyState() (bool, time.Time) {
164 if i == nil {
165 return false, time.Time{}
166 }
167
168 ts := time.Time{}
169 if i.ReadOnlyUpdatedTimestamp > 0 {
170 ts = time.Unix(i.ReadOnlyUpdatedTimestamp, 0)
171 }
172
173 return i.ReadOnly, ts
174}
175
176func (i *InstanceDesc) IsHealthy(op Operation, heartbeatTimeout time.Duration, now time.Time) bool {
177 healthy := op.IsInstanceInStateHealthy(i.State)

Calls

no outgoing calls