Ask Discourse gave this explanation. I knew there was a way to regenerate user summaries. Not a fan of direct Ask Discourse copy-pastes, but since you wanted an answer…
Recalculating User Activity and Summaries AI
NateDhaliwal:
How do I recalculate user activity and summaries?
DiscourseHelper:
Thinking
The user is asking about how to recalculate user activity and summaries in Discourse. Let me search for this information.
Searching
Searching for: recalculate user activity and summaries
The search results mention activity summary emails but don’t directly answer the question about how to recalculate user activity and summaries. This sounds like it could be about the admin site settings or rake tasks. Let me search more specifically for “recalculate” and also look at the user summaries page which is an admin feature.
Searching
Searching for: recalculate user summaries activity admin rake task
Let me look at the “Configuring Activity Summary emails” documentation topic (36627) and also the “User Summary Stats Out of Sync” topic (166124) which seems more relevant to recalculating. Let me also search for the admin dashboard or site settings related to this.
Reading
Read: Configuring Activity Summary emails
Searching
Searching for: admin dashboard rebuild user summary stats recalculate update
Let me look at some of the most relevant topics: “User Summary Stats Out of Sync”, “How to re-calculate the top users stats?”, “How to Reset Site Statistics or Recalculate?”, and “User stats wrong/not up to date”. These seem relevant. Let me also check the admin site settings for something like “top_recalculate” or similar.
Reading
Read: User Summary Stats Out of Sync
Reading
Read: How to re-calculate the top users stats?
Let me also check the “User stats wrong/not up to date” topic and the “How to Reset Site Statistics or Recalculate?” topic for more comprehensive information about recalculating user activity and summaries.
Reading
Read: User stats wrong/not up to date
Reading
Read: How to Reset Site Statistics or Recalculate?
Now let me also search for the specific site setting or admin option related to recalculating user activity. Let me also search for “top_recalculate” or “update_all_with_api_call” or something about admin site settings.
Searching
Searching for: recalculate user stats top users directory items update rake task users
Now let me check if there’s a site setting related to recalculating user activity stats. Let me also look at the “Administrative bulk operations” topic which was referenced in the “How to Reset Site Statistics” topic.
Searching
Searching for: administrative bulk operations rake recalculate user stats
Let me read the “Administrative Bulk Operations” topic which contains rake commands for bulk operations, including recalculating stats.
Reading
Read: Administrative Bulk Operations
Now I have good information. The user is asking how to recalculate user activity and summaries. Based on what I’ve found:
- User stats (post counts, topic counts, etc.) are recalculated automatically once a day via a Sidekiq job.
- For manually triggering a recalculation, you can use the rake task
rake users:recalculate_post_counts(from the “User Summary Stats Out of Sync” topic). - For site statistics (admin panel), you can use
rake destroy:statsto reset them, and they will recalculate. - For directory items (the /users page), those are updated by a daily Sidekiq job.However, the user is asking this as an admin question. Let me note that:
- Hosted customers don’t have terminal access- The automatic recalculation happens daily via Sidekiq scheduled jobs
Let me also check if there’s a site setting for this or an admin panel option. Let me search for the site settings related to this.
Searching site settings
Found 51 results for ‘recalculate,summary,activity,stats’
Let me search for the specific topic that might be relevant - about how to update user summaries and activities after actions that don’t automatically trigger updates. Let me look at the “Why are stats not updated in real time?” topic and the “Rebuild User Actions” topic.
Reading
Read: Rebuild User Actions
Now I have enough information to provide a comprehensive answer. Let me also look at the site setting for top_topics and search for how the “recalculate” site setting works for admin dashboard purposes. But I think I’ve gathered enough to answer.
Based on my research:
-
Automatic recalculation: User activity stats and summaries are automatically recalculated once a day via scheduled Sidekiq jobs. You can find these at
/sidekiq/schedulerby searching for “stats”. -
Manual recalculation (requires SSH access - self-hosted only):
rake users:recalculate_post_counts- to fix user post/topic counts that are out of syncrake destroy:stats- to reset site statistics (admin panel stats) so they recalculateUserStat.update_statsin rails console - for individual user statsimport:ensure_consistency- for post-import issues
-
For hosted customers: They would need to contact support@discourse.org to have these rake tasks run, or simply wait for the daily automatic recalculation.
Let me formulate the response.
User activity stats and summaries in Discourse are recalculated automatically once a day via scheduled Sidekiq jobs. You can verify these jobs ran by visiting /sidekiq/scheduler (self-hosted) and searching for “stats” — you’ll see jobs like Jobs::DashboardStats, Jobs::AboutStats, and Jobs::CategoryStats.
If stats appear out of sync and you need to trigger a manual recalculation:
Self-hosted (SSH access required)
Enter your container first (./launcher enter app), then:
-
Recalculate user post/topic counts:
rake users:recalculate_post_counts -
Reset site-wide statistics (admin panel /
/aboutpage — they’ll auto-recalculate after):rake destroy:stats -
For a single user’s stats (via
rails c):UserStat.update_stats(user) -
After imports, run:
rake import:ensure_consistency
Hosted customers
Since you don’t have terminal access, the automatic daily recalculation should handle this. If stats remain incorrect after a day, contact team@discourse.org and they can run these tasks for you.
Note: The “Activity Summary” email (digest) is generated fresh at send time based on the user’s last visit, so it doesn’t need a separate recalculation. If a user isn’t receiving it, see Configuring Activity Summary emails for troubleshooting steps.
Sources: