mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-08 15:18:58 +08:00
Previously, `DiscourseUpdates.has_unseen_features?` ran the full new features pipeline on every request for staff users — parsing JSON, shelling out to `git merge-base` per entry via `GitUtils.has_commit?`, merging with upcoming changes, and sorting — taking 300-400ms to produce a single boolean. In this update, the max `created_at` timestamp across all valid merged features is computed once and cached in Redis, reducing `has_unseen_features?` to two Redis GETs and an integer comparison; the cache is invalidated when the daily job fetches new features, on deploy/restart, and when an upcoming change transitions to permanent. |
||
|---|---|---|
| .. | ||
| notification_data_merger.rb | ||
| notify_admins_of_available_change.rb | ||
| track_notify_added_changes.rb | ||
| track_notify_status_changes.rb | ||
| track_removed_changes.rb | ||