ruby on rails - How to tell if sidekiq is connected to redis server? -
using console, how can tell if sidekiq connected redis server? want able this:
if (sidekiq connected redis) # psuedo code mrworker.perform_async('do_work', user.id) else mrworker.new.perform('do_work', user.id) end
you can use redis info provided sidekiq:
redis_info = sidekiq.redis { |conn| conn.info } redis_info['connected_clients'] # => "16"
Comments
Post a Comment