store/sqlstore cleanup and postgres tests (#7595)
* sqlstore cleanup / postgres tests * remove stopped containers * cmd/platform compile fix * remove test-postgres target from makefile
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
70e5f00241
Коммит
0f66b6e726
@@ -187,7 +187,7 @@ func (a *App) RecycleDatabaseConnection() {
|
||||
oldStore := a.Srv.Store
|
||||
|
||||
l4g.Warn(utils.T("api.admin.recycle_db_start.warn"))
|
||||
a.Srv.Store = store.NewLayeredStore(sqlstore.NewSqlSupplier(a.Metrics), a.Metrics, a.Cluster)
|
||||
a.Srv.Store = store.NewLayeredStore(sqlstore.NewSqlSupplier(utils.Cfg.SqlSettings, a.Metrics), a.Metrics, a.Cluster)
|
||||
|
||||
a.Jobs.Store = a.Srv.Store
|
||||
|
||||
|
||||
@@ -613,6 +613,10 @@ func (a *App) SearchPostsInTeam(terms string, userId string, teamId string, isOr
|
||||
|
||||
return postList, nil
|
||||
} else {
|
||||
if !*utils.Cfg.ServiceSettings.EnablePostSearch {
|
||||
return nil, model.NewAppError("SearchPostsInTeam", "store.sql_post.search.disabled", nil, fmt.Sprintf("teamId=%v userId=%v", teamId, userId), http.StatusNotImplemented)
|
||||
}
|
||||
|
||||
channels := []store.StoreChannel{}
|
||||
|
||||
for _, params := range paramsList {
|
||||
|
||||
@@ -85,7 +85,7 @@ func (a *App) NewServer() {
|
||||
}
|
||||
|
||||
func (a *App) InitStores() {
|
||||
a.Srv.Store = store.NewLayeredStore(sqlstore.NewSqlSupplier(a.Metrics), a.Metrics, a.Cluster)
|
||||
a.Srv.Store = store.NewLayeredStore(sqlstore.NewSqlSupplier(utils.Cfg.SqlSettings, a.Metrics), a.Metrics, a.Cluster)
|
||||
}
|
||||
|
||||
type VaryBy struct{}
|
||||
|
||||
@@ -438,7 +438,7 @@ func (a *App) GetUsersPage(page int, perPage int, asAdmin bool) ([]*model.User,
|
||||
}
|
||||
|
||||
func (a *App) GetUsersEtag() string {
|
||||
return (<-a.Srv.Store.User().GetEtagForAllProfiles()).Data.(string)
|
||||
return fmt.Sprintf("%v.%v.%v", (<-a.Srv.Store.User().GetEtagForAllProfiles()).Data.(string), utils.Cfg.PrivacySettings.ShowFullName, utils.Cfg.PrivacySettings.ShowEmailAddress)
|
||||
}
|
||||
|
||||
func (a *App) GetUsersInTeam(teamId string, offset int, limit int) ([]*model.User, *model.AppError) {
|
||||
@@ -492,11 +492,11 @@ func (a *App) GetUsersNotInTeamPage(teamId string, page int, perPage int, asAdmi
|
||||
}
|
||||
|
||||
func (a *App) GetUsersInTeamEtag(teamId string) string {
|
||||
return (<-a.Srv.Store.User().GetEtagForProfiles(teamId)).Data.(string)
|
||||
return fmt.Sprintf("%v.%v.%v", (<-a.Srv.Store.User().GetEtagForProfiles(teamId)).Data.(string), utils.Cfg.PrivacySettings.ShowFullName, utils.Cfg.PrivacySettings.ShowEmailAddress)
|
||||
}
|
||||
|
||||
func (a *App) GetUsersNotInTeamEtag(teamId string) string {
|
||||
return (<-a.Srv.Store.User().GetEtagForProfilesNotInTeam(teamId)).Data.(string)
|
||||
return fmt.Sprintf("%v.%v.%v", (<-a.Srv.Store.User().GetEtagForProfilesNotInTeam(teamId)).Data.(string), utils.Cfg.PrivacySettings.ShowFullName, utils.Cfg.PrivacySettings.ShowEmailAddress)
|
||||
}
|
||||
|
||||
func (a *App) GetUsersInChannel(channelId string, offset int, limit int) ([]*model.User, *model.AppError) {
|
||||
|
||||
Ссылка в новой задаче
Block a user