diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-07-18 11:10:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-18 11:10:03 -0400 |
commit | c0ab2636d699c8544ce03a58f61b95cfd66ff7ce (patch) | |
tree | c7d07934e0ff1a75aafb097a184ae150888199c0 /mattermost.go | |
parent | 180adc79af3d14de6ce62f6e687a6735db3fe82f (diff) | |
download | chat-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.go | 10 |
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)) } |