mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
Fix n+1 on currently_hacking email list (#319)
This commit is contained in:
2
app/jobs/cache/currently_hacking_job.rb
vendored
2
app/jobs/cache/currently_hacking_job.rb
vendored
@@ -15,7 +15,7 @@ class Cache::CurrentlyHackingJob < Cache::ActivityJob
|
||||
.where("time > ?", 5.minutes.ago.to_f)
|
||||
.select("DISTINCT ON (user_id) user_id, project, time, users.*")
|
||||
.order("user_id, time DESC")
|
||||
.includes(user: :project_repo_mappings)
|
||||
.includes(user: [ :project_repo_mappings, :email_addresses ])
|
||||
.index_by(&:user_id)
|
||||
|
||||
users = recent_heartbeats.values.map(&:user)
|
||||
|
||||
Reference in New Issue
Block a user