Skip to content

Commit

Permalink
Merge acf6cab into 7db5654
Browse files Browse the repository at this point in the history
  • Loading branch information
aki77 committed Jun 28, 2017
2 parents 7db5654 + acf6cab commit a896200
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/delayed/tasks.rb
Expand Up @@ -30,7 +30,7 @@
task :check, [:max_age] => :environment do |_, args|
args.with_defaults(:max_age => 300)

unprocessed_jobs = Delayed::Job.where('attempts = 0 AND created_at < ?', Time.now - args[:max_age].to_i).count
unprocessed_jobs = Delayed::Job.where('attempts = 0 AND run_at < ?', Time.now - args[:max_age].to_i).count

if unprocessed_jobs > 0
raise "#{unprocessed_jobs} jobs older than #{args[:max_age]} seconds have not been processed yet"
Expand Down

0 comments on commit a896200

Please sign in to comment.