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

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

@@ -2649,6 +2649,7 @@ func TestPermanentDeleteAllUsers(t *testing.T) {
require.NoError(t, err)
require.Greater(t, len(users), 0)
require.NoError(t, th.App.Srv().Store().Post().RefreshPostStats())
postCount, err := th.App.Srv().Store().Post().AnalyticsPostCount(&model.PostCountOptions{})
require.NoError(t, err)
require.Greater(t, postCount, int64(0))
@@ -2662,6 +2663,7 @@ func TestPermanentDeleteAllUsers(t *testing.T) {
require.NoError(t, err)
require.Len(t, users, 0)
require.NoError(t, th.App.Srv().Store().Post().RefreshPostStats())
postCount, err = th.App.Srv().Store().Post().AnalyticsPostCount(&model.PostCountOptions{})
require.NoError(t, err)
require.Equal(t, postCount, int64(0))