Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Fixing a performance & memory leak in the polling of the Job Queue length. #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/hirefireapp/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ def count_delayed_job
where(:failed_at => nil).
where('run_at <= ?', Time.now).count
else
Delayed::Job.all(
Delayed::Job.count(:id,
:conditions => [
'failed_at IS NULL and run_at <= ?', Time.now.utc
]
).count
)
end
elsif defined?(Mongoid) and backend?(/Mongoid/)
Delayed::Job.where(
Expand Down