[MM-16173] Migrate Team.AnalyticsTeamCount to Sync by default #11126 (#11132)

* [MM-16173] Migrate Team.AnalyticsTeamCount to Sync by default #11126
+ Modified team_store.AnalyticsTeamCount to return (int64, *model.AppError) instead of store.StoreChannel.
+ Updated the mock store to reflect new return value.
+ Updated referencing code to handle new sync return value.

* Fix shadowing of the err

* Fix the empty line between related code

* Fix team count call to be an explicit async.

* Added error logging to diagnostics.go

* Fix gofmt in file
Этот коммит содержится в:
Kyle Reczek
2019-06-14 08:01:24 -06:00
коммит произвёл Christopher Poile
родитель e101e1c020
Коммит b61ded0ae4
9 изменённых файлов: 44 добавлений и 34 удалений

Просмотреть файл

@@ -79,8 +79,8 @@ func (s *Server) DoSecurityUpdateCheck() {
v.Set(PROP_SECURITY_ACTIVE_USER_COUNT, strconv.FormatInt(ucr.Data.(int64), 10))
}
if tcr := <-s.Store.Team().AnalyticsTeamCount(); tcr.Err == nil {
v.Set(PROP_SECURITY_TEAM_COUNT, strconv.FormatInt(tcr.Data.(int64), 10))
if teamCount, err := s.Store.Team().AnalyticsTeamCount(); err == nil {
v.Set(PROP_SECURITY_TEAM_COUNT, strconv.FormatInt(teamCount, 10))
}
res, err := http.Get(SECURITY_URL + "/security?" + v.Encode())