mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Add context to org (#40685)
* Add context to org * Rebase * Fix rebase
This commit is contained in:
@@ -39,7 +39,7 @@ type ProvisioningService interface {
|
||||
RunInitProvisioners(ctx context.Context) error
|
||||
ProvisionDatasources(ctx context.Context) error
|
||||
ProvisionPlugins() error
|
||||
ProvisionNotifications() error
|
||||
ProvisionNotifications(ctx context.Context) error
|
||||
ProvisionDashboards(ctx context.Context) error
|
||||
GetDashboardProvisionerResolvedPath(name string) string
|
||||
GetAllowUIUpdatesFromConfig(name string) bool
|
||||
@@ -59,7 +59,7 @@ func NewProvisioningServiceImpl() *ProvisioningServiceImpl {
|
||||
// Used for testing purposes
|
||||
func newProvisioningServiceImpl(
|
||||
newDashboardProvisioner dashboards.DashboardProvisionerFactory,
|
||||
provisionNotifiers func(string, encryption.Service) error,
|
||||
provisionNotifiers func(context.Context, string, encryption.Service) error,
|
||||
provisionDatasources func(context.Context, string) error,
|
||||
provisionPlugins func(string, plugifaces.Store) error,
|
||||
) *ProvisioningServiceImpl {
|
||||
@@ -81,7 +81,7 @@ type ProvisioningServiceImpl struct {
|
||||
pollingCtxCancel context.CancelFunc
|
||||
newDashboardProvisioner dashboards.DashboardProvisionerFactory
|
||||
dashboardProvisioner dashboards.DashboardProvisioner
|
||||
provisionNotifiers func(string, encryption.Service) error
|
||||
provisionNotifiers func(context.Context, string, encryption.Service) error
|
||||
provisionDatasources func(context.Context, string) error
|
||||
provisionPlugins func(string, plugifaces.Store) error
|
||||
mutex sync.Mutex
|
||||
@@ -98,7 +98,7 @@ func (ps *ProvisioningServiceImpl) RunInitProvisioners(ctx context.Context) erro
|
||||
return err
|
||||
}
|
||||
|
||||
err = ps.ProvisionNotifications()
|
||||
err = ps.ProvisionNotifications(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -147,15 +147,15 @@ func (ps *ProvisioningServiceImpl) ProvisionPlugins() error {
|
||||
return errutil.Wrap("app provisioning error", err)
|
||||
}
|
||||
|
||||
func (ps *ProvisioningServiceImpl) ProvisionNotifications() error {
|
||||
func (ps *ProvisioningServiceImpl) ProvisionNotifications(ctx context.Context) error {
|
||||
alertNotificationsPath := filepath.Join(ps.Cfg.ProvisioningPath, "notifiers")
|
||||
err := ps.provisionNotifiers(alertNotificationsPath, ps.EncryptionService)
|
||||
err := ps.provisionNotifiers(ctx, alertNotificationsPath, ps.EncryptionService)
|
||||
return errutil.Wrap("Alert notification provisioning error", err)
|
||||
}
|
||||
|
||||
func (ps *ProvisioningServiceImpl) ProvisionDashboards(ctx context.Context) error {
|
||||
dashboardPath := filepath.Join(ps.Cfg.ProvisioningPath, "dashboards")
|
||||
dashProvisioner, err := ps.newDashboardProvisioner(dashboardPath, ps.SQLStore)
|
||||
dashProvisioner, err := ps.newDashboardProvisioner(ctx, dashboardPath, ps.SQLStore)
|
||||
if err != nil {
|
||||
return errutil.Wrap("Failed to create provisioner", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user