Move cluster, webhub and store out of Server (#20899)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
203df2f537
Коммит
5e69c6b02f
@@ -70,8 +70,8 @@ func SetupWithStoreMock(t testing.TB) *testHelper {
|
||||
systemStore.On("Get").Return(make(model.StringMap), nil)
|
||||
licenseStore := mocks.LicenseStore{}
|
||||
licenseStore.On("Get", "").Return(&model.LicenseRecord{}, nil)
|
||||
api4TestHelper.App.Srv().Store.(*mocks.Store).On("System").Return(&systemStore)
|
||||
api4TestHelper.App.Srv().Store.(*mocks.Store).On("License").Return(&licenseStore)
|
||||
api4TestHelper.App.Srv().Store().(*mocks.Store).On("System").Return(&systemStore)
|
||||
api4TestHelper.App.Srv().Store().(*mocks.Store).On("License").Return(&licenseStore)
|
||||
|
||||
testHelper := &testHelper{
|
||||
TestHelper: api4TestHelper,
|
||||
|
||||
@@ -122,7 +122,7 @@ func resetCmdF(command *cobra.Command, args []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
a.Srv().Store.DropAllTables()
|
||||
a.Srv().Store().DropAllTables()
|
||||
CommandPrettyPrintln("Database successfully reset")
|
||||
|
||||
auditRec := a.MakeAuditRecord("reset", audit.Success)
|
||||
|
||||
@@ -174,11 +174,11 @@ func bulkImportCmdF(command *cobra.Command, args []string) error {
|
||||
|
||||
func getTeamFromTeamArg(a *app.App, teamArg string) *model.Team {
|
||||
var team *model.Team
|
||||
team, err := a.Srv().Store.Team().GetByName(teamArg)
|
||||
team, err := a.Srv().Store().Team().GetByName(teamArg)
|
||||
|
||||
if err != nil {
|
||||
var t *model.Team
|
||||
if t, err = a.Srv().Store.Team().Get(teamArg); err == nil {
|
||||
if t, err = a.Srv().Store().Team().Get(teamArg); err == nil {
|
||||
team = t
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,6 @@ func initDBCommandContext(configDSN string, readOnlyConfigStore bool) (*app.App,
|
||||
// The option order is important as app.Config option reads app.StartMetrics option.
|
||||
app.StartMetrics,
|
||||
app.Config(configDSN, readOnlyConfigStore, nil),
|
||||
app.StartSearchEngine,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -70,7 +70,6 @@ func runServer(configStore *config.Store, interruptChan chan os.Signal) error {
|
||||
app.ConfigStore(configStore),
|
||||
app.RunEssentialJobs,
|
||||
app.JoinCluster,
|
||||
app.StartSearchEngine,
|
||||
}
|
||||
server, err := app.NewServer(options...)
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user