(fn func())
| 335 | } |
| 336 | |
| 337 | func (i *Lifecycler) sendToLifecyclerLoop(fn func()) error { |
| 338 | sc := i.ServiceContext() |
| 339 | if sc == nil { |
| 340 | return errors.New("lifecycler not running") |
| 341 | } |
| 342 | |
| 343 | select { |
| 344 | case <-sc.Done(): |
| 345 | return errors.New("lifecycler not running") |
| 346 | case i.actorChan <- fn: |
| 347 | return nil |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | // ChangeState of the ingester, for use off of the loop() goroutine. |
| 352 | func (i *Lifecycler) ChangeState(ctx context.Context, state InstanceState) error { |
no test coverage detected