[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 удалений

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

@@ -478,13 +478,13 @@ func (me *TestHelper) ResetEmojisMigration() {
}
func (me *TestHelper) CheckTeamCount(t *testing.T, expected int64) {
if r := <-me.App.Srv.Store.Team().AnalyticsTeamCount(); r.Err == nil {
if r.Data.(int64) != expected {
t.Fatalf("Unexpected number of teams. Expected: %v, found: %v", expected, r.Data.(int64))
}
} else {
teamCount, err := me.App.Srv.Store.Team().AnalyticsTeamCount()
if err != nil {
t.Fatalf("Failed to get team count.")
}
if teamCount != expected {
t.Fatalf("Unexpected number of teams. Expected: %v, found: %v", expected, teamCount)
}
}
func (me *TestHelper) CheckChannelsCount(t *testing.T, expected int64) {