summaryrefslogtreecommitdiffstats
path: root/mattermost.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-07-18 11:10:03 -0400
committerGitHub <noreply@github.com>2016-07-18 11:10:03 -0400
commitc0ab2636d699c8544ce03a58f61b95cfd66ff7ce (patch)
treec7d07934e0ff1a75aafb097a184ae150888199c0 /mattermost.go
parent180adc79af3d14de6ce62f6e687a6735db3fe82f (diff)
downloadchat-c0ab2636d699c8544ce03a58f61b95cfd66ff7ce.tar.gz
chat-c0ab2636d699c8544ce03a58f61b95cfd66ff7ce.tar.bz2
chat-c0ab2636d699c8544ce03a58f61b95cfd66ff7ce.zip
PLT-2241 Refactored statuses into a more real-time system (#3573)
* Refactored statuses into a more real-time system * Updated package.json with correct commit and fixed minor bug * Minor updates to statuses based on feedback * When setting status online, update only LastActivityAt if status already exists
Diffstat (limited to 'mattermost.go')
-rw-r--r--mattermost.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/mattermost.go b/mattermost.go
index 14f297a66..c07c38b2b 100644
--- a/mattermost.go
+++ b/mattermost.go
@@ -125,6 +125,8 @@ func main() {
if flagRunCmds {
runCmds()
} else {
+ resetStatuses()
+
api.StartServer()
// If we allow testing then listen for manual testing URL hits
@@ -149,6 +151,12 @@ func main() {
}
}
+func resetStatuses() {
+ if result := <-api.Srv.Store.Status().ResetAll(); result.Err != nil {
+ l4g.Error(utils.T("mattermost.reset_status.error"), result.Err.Error())
+ }
+}
+
func setDiagnosticId() {
if result := <-api.Srv.Store.System().Get(); result.Err == nil {
props := result.Data.(model.StringMap)
@@ -200,7 +208,7 @@ func doSecurityAndDiagnostics() {
v.Set(utils.PROP_DIAGNOSTIC_USER_COUNT, strconv.FormatInt(ucr.Data.(int64), 10))
}
- if ucr := <-api.Srv.Store.User().GetTotalActiveUsersCount(); ucr.Err == nil {
+ if ucr := <-api.Srv.Store.Status().GetTotalActiveUsersCount(); ucr.Err == nil {
v.Set(utils.PROP_DIAGNOSTIC_ACTIVE_USER_COUNT, strconv.FormatInt(ucr.Data.(int64), 10))
}