[MM-44263] Cache Posts Usage (#20254)
* Fetch users only posts * Cache Posts Usage * Explicitly validate posts count before testing usage * Add DocString * Revert cache changes * Revert "Revert cache changes" This reverts commit ba693f8d5028b62c19f6a730e8dca73a224d0761.
Этот коммит содержится в:
@@ -47,7 +47,7 @@ func (ch *Channels) getIntegrationsUsage() (*model.IntegrationsUsage, *model.App
|
||||
|
||||
// GetPostsUsage returns "rounded off" total posts count like returns 900 instead of 987
|
||||
func (a *App) GetPostsUsage() (int64, *model.AppError) {
|
||||
count, err := a.Srv().Store.Post().AnalyticsPostCount(&model.PostCountOptions{ExcludeDeleted: true, UsersPostsOnly: true})
|
||||
count, err := a.Srv().Store.Post().AnalyticsPostCount(&model.PostCountOptions{ExcludeDeleted: true, UsersPostsOnly: true, AllowFromCache: true})
|
||||
if err != nil {
|
||||
return 0, model.NewAppError("GetPostsUsage", "app.post.analytics_posts_count.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user