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

Method GetReadOnlyState

ring/lifecycler.go:416–420  ·  view source on GitHub ↗

GetReadOnlyState returns the read-only state of this instance -- whether instance is read-only, and when what the last update of read-only state (possibly zero).

()

Source from the content-addressed store, hash-verified

414// GetReadOnlyState returns the read-only state of this instance -- whether instance is read-only, and when what the last
415// update of read-only state (possibly zero).
416func (i *Lifecycler) GetReadOnlyState() (bool, time.Time) {
417 i.stateMtx.RLock()
418 defer i.stateMtx.RUnlock()
419 return i.readOnly, i.readOnlyLastUpdated
420}
421
422func (i *Lifecycler) setReadOnlyState(readOnly bool, readOnlyLastUpdated time.Time) {
423 i.stateMtx.Lock()

Callers 5

ChangeReadOnlyStateMethod · 0.95
initRingMethod · 0.95
verifyTokensMethod · 0.95
autoJoinMethod · 0.95
updateConsulMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected