class Zhong::Web
Most of the following helpers are copied from a previous version of the Sidekiq project available here: github.com/mperham/sidekiq/blob/2c9f7662fcdcb52d59b72ba0fe7dc5f963de4904/lib/sidekiq/web.rb
Public Instance Methods
index()
click to toggle source
# File lib/zhong/web.rb, line 59 def index @jobs = Zhong.jobs.values @last_runs = zhong_mget(@jobs, "last_ran") @disabled = zhong_mget(@jobs, "disabled") @hosts = Zhong.all_heartbeats end
zhong_mget(jobs, key)
click to toggle source
# File lib/zhong/web.rb, line 66 def zhong_mget(jobs, key) keys = jobs.map(&:to_s) ret = Zhong::Util.safe_mget(keys.map { |j| "zhong:#{key}:#{j}" }) Hash[keys.map { |j| [j, ret["zhong:#{key}:#{j}"]] }] end