add dashboardsnap as service of http server (#45461)

This commit is contained in:
ying-jeanne
2022-02-17 09:31:26 +01:00
committed by GitHub
parent bb86ba99ee
commit 10b47480eb
4 changed files with 15 additions and 11 deletions
+4
View File
@@ -34,6 +34,7 @@ import (
"github.com/grafana/grafana/pkg/services/cleanup"
"github.com/grafana/grafana/pkg/services/contexthandler"
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/dashboardsnapshots"
"github.com/grafana/grafana/pkg/services/datasourceproxy"
"github.com/grafana/grafana/pkg/services/datasources"
"github.com/grafana/grafana/pkg/services/encryption"
@@ -136,6 +137,7 @@ type HTTPServer struct {
folderService dashboards.FolderService
DatasourcePermissionsService DatasourcePermissionsService
AlertNotificationService *alerting.AlertNotificationService
DashboardsnapshotsService *dashboardsnapshots.Service
}
type ServerOptions struct {
@@ -166,6 +168,7 @@ func ProvideHTTPServer(opts ServerOptions, cfg *setting.Cfg, routeRegister routi
notificationService *notifications.NotificationService, dashboardService dashboards.DashboardService,
dashboardProvisioningService dashboards.DashboardProvisioningService, folderService dashboards.FolderService,
datasourcePermissionsService DatasourcePermissionsService, alertNotificationService *alerting.AlertNotificationService,
dashboardsnapshotsService *dashboardsnapshots.Service,
) (*HTTPServer, error) {
web.Env = cfg.Env
m := web.New()
@@ -232,6 +235,7 @@ func ProvideHTTPServer(opts ServerOptions, cfg *setting.Cfg, routeRegister routi
folderService: folderService,
DatasourcePermissionsService: datasourcePermissionsService,
AlertNotificationService: alertNotificationService,
DashboardsnapshotsService: dashboardsnapshotsService,
}
if hs.Listener != nil {
hs.log.Debug("Using provided listener")