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

Function StartManagerAndAwaitHealthy

services/manager.go:374–381  ·  view source on GitHub ↗

StartManagerAndAwaitHealthy starts the manager (which in turns starts all services managed by it), and then waits until it reaches Running state. All services that this manager manages must be in New state, otherwise starting will fail. Notice that context passed to the manager for starting its ser

(ctx context.Context, manager *Manager)

Source from the content-addressed store, hash-verified

372//
373// Notice that context passed to the manager for starting its services is the same as context used for waiting!
374func StartManagerAndAwaitHealthy(ctx context.Context, manager *Manager) error {
375 err := manager.StartAsync(ctx)
376 if err != nil {
377 return err
378 }
379
380 return manager.AwaitHealthy(ctx)
381}
382
383// StopManagerAndAwaitStopped asks manager to stop its services, and then waits
384// until manager reaches the stopped state or context is stopped.

Calls 2

AwaitHealthyMethod · 0.80
StartAsyncMethod · 0.65