summaryrefslogtreecommitdiffstats
path: root/mattermost.go
diff options
context:
space:
mode:
authorStas Vovk <stas@vovk.me>2015-10-16 14:21:51 +0300
committerStas Vovk <stas@vovk.me>2015-10-16 14:21:51 +0300
commit79fcb9808421dd93342a9538d05dd2259f5dd14b (patch)
tree33a1a865144f280e37fde07a7c91ed8825c53801 /mattermost.go
parent2bd81ff379acb347534e4d6a1a27624e0262deb0 (diff)
parent50a8e2bd4fa53c6bb2f12a03237be4fbaf259617 (diff)
downloadchat-79fcb9808421dd93342a9538d05dd2259f5dd14b.tar.gz
chat-79fcb9808421dd93342a9538d05dd2259f5dd14b.tar.bz2
chat-79fcb9808421dd93342a9538d05dd2259f5dd14b.zip
Merge remote-tracking branch 'upstream/master' into PLT-637
Conflicts: web/react/utils/constants.jsx
Diffstat (limited to 'mattermost.go')
-rw-r--r--mattermost.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/mattermost.go b/mattermost.go
index d2a0567f4..48487ee73 100644
--- a/mattermost.go
+++ b/mattermost.go
@@ -84,16 +84,16 @@ func securityAndDiagnosticsJob() {
if *utils.Cfg.ServiceSettings.EnableSecurityFixAlert {
if result := <-api.Srv.Store.System().Get(); result.Err == nil {
props := result.Data.(model.StringMap)
- lastSecurityTime, _ := strconv.ParseInt(props["LastSecurityTime"], 10, 0)
+ lastSecurityTime, _ := strconv.ParseInt(props[model.SYSTEM_LAST_SECURITY_TIME], 10, 0)
currentTime := model.GetMillis()
if (currentTime - lastSecurityTime) > 1000*60*60*24*1 {
l4g.Debug("Checking for security update from Mattermost")
- id := props["DiagnosticId"]
+ id := props[model.SYSTEM_DIAGNOSTIC_ID]
if len(id) == 0 {
id = model.NewId()
- systemId := &model.System{Name: "DiagnosticId", Value: id}
+ systemId := &model.System{Name: model.SYSTEM_DIAGNOSTIC_ID, Value: id}
<-api.Srv.Store.System().Save(systemId)
}
@@ -104,7 +104,13 @@ func securityAndDiagnosticsJob() {
v.Set(utils.PROP_DIAGNOSTIC_OS, runtime.GOOS)
v.Set(utils.PROP_DIAGNOSTIC_CATEGORY, utils.VAL_DIAGNOSTIC_CATEGORY_DEFAULT)
- systemSecurityLastTime := &model.System{Name: "LastSecurityTime", Value: strconv.FormatInt(currentTime, 10)}
+ if len(props[model.SYSTEM_RAN_UNIT_TESTS]) > 0 {
+ v.Set(utils.PROP_DIAGNOSTIC_UNIT_TESTS, "1")
+ } else {
+ v.Set(utils.PROP_DIAGNOSTIC_UNIT_TESTS, "0")
+ }
+
+ systemSecurityLastTime := &model.System{Name: model.SYSTEM_LAST_SECURITY_TIME, Value: strconv.FormatInt(currentTime, 10)}
if lastSecurityTime == 0 {
<-api.Srv.Store.System().Save(systemSecurityLastTime)
} else {