Extract search users functions into a service (#39002)

* 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
This commit is contained in:
Selene
2021-09-29 12:51:49 +02:00
committed by GitHub
parent 0ecf13e5a3
commit 02702eb82d
12 changed files with 148 additions and 74 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"
@@ -107,6 +109,7 @@ type HTTPServer struct {
cleanUpService *cleanup.CleanUpService
tracingService *tracing.TracingService
internalMetricsSvc *metrics.InternalMetricsService
searchUsersService searchusers.Service
}
type ServerOptions struct {
@@ -130,7 +133,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()
@@ -177,6 +180,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")