(ctx context.Context)
| 468 | } |
| 469 | |
| 470 | func (r *Ruler) starting(ctx context.Context) error { |
| 471 | // If sharding is enabled, start the used subservices. |
| 472 | if r.cfg.EnableSharding { |
| 473 | var err error |
| 474 | |
| 475 | if r.subservices, err = services.NewManager(r.lifecycler, r.ring, r.clientsPool); err != nil { |
| 476 | return errors.Wrap(err, "unable to start ruler subservices") |
| 477 | } |
| 478 | |
| 479 | r.subservicesWatcher = services.NewFailureWatcher() |
| 480 | r.subservicesWatcher.WatchManager(r.subservices) |
| 481 | |
| 482 | if err = services.StartManagerAndAwaitHealthy(ctx, r.subservices); err != nil { |
| 483 | return errors.Wrap(err, "unable to start ruler subservices") |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | // TODO: ideally, ruler would wait until its queryable is finished starting. |
| 488 | return nil |
| 489 | } |
| 490 | |
| 491 | // Stop stops the Ruler. |
| 492 | // Each function of the ruler is terminated before leaving the ring |
nothing calls this directly
no test coverage detected