summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-10-09 10:16:14 -0700
committerJoram Wilander <jwawilander@gmail.com>2017-10-09 13:16:14 -0400
commit0f66b6e72621842467d0e368b95ee58f485d4ace (patch)
tree444f9210a151cb735fe0502d4bb47c324592c0e6 /app
parent70e5f00241473c27a3008959ce08832c75e76ba8 (diff)
downloadchat-0f66b6e72621842467d0e368b95ee58f485d4ace.tar.gz
chat-0f66b6e72621842467d0e368b95ee58f485d4ace.tar.bz2
chat-0f66b6e72621842467d0e368b95ee58f485d4ace.zip
store/sqlstore cleanup and postgres tests (#7595)
* sqlstore cleanup / postgres tests * remove stopped containers * cmd/platform compile fix * remove test-postgres target from makefile
Diffstat (limited to 'app')
-rw-r--r--app/admin.go2
-rw-r--r--app/post.go4
-rw-r--r--app/server.go2
-rw-r--r--app/user.go6
4 files changed, 9 insertions, 5 deletions
diff --git a/app/admin.go b/app/admin.go
index dab7e9759..a3f7ffa2a 100644
--- a/app/admin.go
+++ b/app/admin.go
@@ -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
diff --git a/app/post.go b/app/post.go
index 497cab5a6..fe9443177 100644
--- a/app/post.go
+++ b/app/post.go
@@ -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 {
diff --git a/app/server.go b/app/server.go
index 5f955dd65..8b09bfef0 100644
--- a/app/server.go
+++ b/app/server.go
@@ -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{}
diff --git a/app/user.go b/app/user.go
index b98583f80..edb4961fc 100644
--- a/app/user.go
+++ b/app/user.go
@@ -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) {