mirror of
https://github.com/grafana/grafana.git
synced 2025-01-05 21:53:45 -06:00
registry: adds more comments
This commit is contained in:
parent
f0f6d0e915
commit
d440b9a8d1
@ -54,14 +54,17 @@ type CanBeDisabled interface {
|
||||
IsDisabled() bool
|
||||
}
|
||||
|
||||
// BackgroundService should be implemented for services that have
|
||||
// long running tasks in the background.
|
||||
type BackgroundService interface {
|
||||
|
||||
// Run starts the background process of the service after `Init` have been called
|
||||
// on all services. The `context.Context` passed into the function should be used
|
||||
// to subscribe to ctx.Done() so the service can be notified when Grafana shuts down.
|
||||
Run(ctx context.Context) error
|
||||
}
|
||||
|
||||
type HasInitPriority interface {
|
||||
GetInitPriority() Priority
|
||||
}
|
||||
|
||||
// IsDisabled takes an service and return true if its disabled
|
||||
func IsDisabled(srv Service) bool {
|
||||
canBeDisabled, ok := srv.(CanBeDisabled)
|
||||
return ok && canBeDisabled.IsDisabled()
|
||||
|
Loading…
Reference in New Issue
Block a user