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

Method ChangeState

ring/lifecycler.go:352–362  ·  view source on GitHub ↗

ChangeState of the ingester, for use off of the loop() goroutine.

(ctx context.Context, state InstanceState)

Source from the content-addressed store, hash-verified

350
351// ChangeState of the ingester, for use off of the loop() goroutine.
352func (i *Lifecycler) ChangeState(ctx context.Context, state InstanceState) error {
353 errCh := make(chan error)
354 fn := func() {
355 errCh <- i.changeState(ctx, state)
356 }
357
358 if err := i.sendToLifecyclerLoop(fn); err != nil {
359 return err
360 }
361 return <-errCh
362}
363
364func (i *Lifecycler) ChangeReadOnlyState(ctx context.Context, readOnly bool) error {
365 errCh := make(chan error)

Callers 1

Calls 2

changeStateMethod · 0.95
sendToLifecyclerLoopMethod · 0.95

Tested by 1