summaryrefslogtreecommitdiffstats
path: root/app/admin.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-10-09 14:59:48 -0700
committerGitHub <noreply@github.com>2017-10-09 14:59:48 -0700
commitbff2b5e735ae7fc80157b4108ddbe56be8acb752 (patch)
tree14867d2bff71b6b638b0b358b1f38eb062cb597f /app/admin.go
parent0f66b6e72621842467d0e368b95ee58f485d4ace (diff)
downloadchat-bff2b5e735ae7fc80157b4108ddbe56be8acb752.tar.gz
chat-bff2b5e735ae7fc80157b4108ddbe56be8acb752.tar.bz2
chat-bff2b5e735ae7fc80157b4108ddbe56be8acb752.zip
Miscellaneous app cleanup (#7594)
* app cleanup * whoops, forgot a file * some minor cleanup * longer container deadline * defensive checks
Diffstat (limited to 'app/admin.go')
-rw-r--r--app/admin.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/admin.go b/app/admin.go
index a3f7ffa2a..5994fc826 100644
--- a/app/admin.go
+++ b/app/admin.go
@@ -15,7 +15,6 @@ import (
l4g "github.com/alecthomas/log4go"
"github.com/mattermost/mattermost-server/model"
- "github.com/mattermost/mattermost-server/store"
"github.com/mattermost/mattermost-server/store/sqlstore"
"github.com/mattermost/mattermost-server/utils"
)
@@ -187,12 +186,13 @@ 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(utils.Cfg.SqlSettings, a.Metrics), a.Metrics, a.Cluster)
-
+ a.Srv.Store = a.newStore()
a.Jobs.Store = a.Srv.Store
- time.Sleep(20 * time.Second)
- oldStore.Close()
+ if a.Srv.Store != oldStore {
+ time.Sleep(20 * time.Second)
+ oldStore.Close()
+ }
l4g.Warn(utils.T("api.admin.recycle_db_end.warn"))
}