[AI assisted]: Improve system console statistics performance (#29899)

```release-note
NONE
```

Co-authored-by: Matthew Birtch <mattbirtch@gmail.com>
Этот коммит содержится в:
Agniva De Sarker
2025-02-04 21:54:01 +05:30
коммит произвёл GitHub
родитель 6046a304b2
Коммит ae9e6174e5
45 изменённых файлов: 1052 добавлений и 407 удалений

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

@@ -53,6 +53,8 @@ func checkNoError(t *testing.T, err *model.AppError) {
}
func AssertAllPostsCount(t *testing.T, a *App, initialCount int64, change int64, teamName string) {
t.Helper()
require.NoError(t, a.Srv().Store().Post().RefreshPostStats())
result, err := a.Srv().Store().Post().AnalyticsPostCount(&model.PostCountOptions{TeamId: teamName})
require.NoError(t, err)
require.Equal(t, initialCount+change, result, "Did not find the expected number of posts.")