Skip to content

Commit

Permalink
feat: resque-status now return null when no active jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Napolskih committed Feb 29, 2016
1 parent d3928bf commit 990f62e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/resque-status
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ elsif key == :oldest
workers = Resque.workers
jobs = workers.map(&:job)
worker_jobs = workers.zip(jobs).reject { |w, j| w.idle? || j['queue'].nil? }
puts worker_jobs.map { |_, job| (Time.now.utc - DateTime.strptime(job['run_at'] ,'%Y-%m-%dT%H:%M:%S').utc).to_i }.max
puts worker_jobs.map { |_, job| (Time.now.utc - DateTime.strptime(job['run_at'] ,'%Y-%m-%dT%H:%M:%S').utc).to_i }.max || 'null'
else
$stderr.puts "Unknown key. Should be one of the [#{info.keys.join(', ')}]"
end

0 comments on commit 990f62e

Please sign in to comment.