Extract search users functions into a service (#39002) (#39770)

* Extract search users to a new service

* Fix wire provider

* Fix common_test and remove RouteRegister

* Remove old endpoints

* Fix test

* Add indexes to dashboards and orgs tables

* Fix lint

(cherry picked from commit 02702eb82d)
This commit is contained in:
Selene
2021-09-29 17:02:58 +02:00
committed by GitHub
parent 4699620e23
commit d07ed05918
11 changed files with 139 additions and 69 deletions
+5 -1
View File
@@ -13,6 +13,8 @@ import (
"strings"
"sync"
"github.com/grafana/grafana/pkg/services/searchusers"
"github.com/grafana/grafana/pkg/api/routing"
httpstatic "github.com/grafana/grafana/pkg/api/static"
"github.com/grafana/grafana/pkg/bus"
@@ -109,6 +111,7 @@ type HTTPServer struct {
cleanUpService *cleanup.CleanUpService
tracingService *tracing.TracingService
internalMetricsSvc *metrics.InternalMetricsService
searchUsersService searchusers.Service
}
type ServerOptions struct {
@@ -133,7 +136,7 @@ func ProvideHTTPServer(opts ServerOptions, cfg *setting.Cfg, routeRegister routi
notificationService *notifications.NotificationService, tracingService *tracing.TracingService,
internalMetricsSvc *metrics.InternalMetricsService, quotaService *quota.QuotaService,
socialService social.Service, oauthTokenService oauthtoken.OAuthTokenService,
encryptionService encryption.Service) (*HTTPServer, error) {
encryptionService encryption.Service, searchUsersService searchusers.Service) (*HTTPServer, error) {
macaron.Env = cfg.Env
m := macaron.New()
@@ -181,6 +184,7 @@ func ProvideHTTPServer(opts ServerOptions, cfg *setting.Cfg, routeRegister routi
SocialService: socialService,
OAuthTokenService: oauthTokenService,
EncryptionService: encryptionService,
searchUsersService: searchUsersService,
}
if hs.Listener != nil {
hs.log.Debug("Using provided listener")