lib/sidekiq/limit_fetch/global/monitor.rb in sidekiq-limit_fetch-1.5 vs lib/sidekiq/limit_fetch/global/monitor.rb in sidekiq-limit_fetch-1.6

- old
+ new

@@ -3,12 +3,12 @@ extend self HEARTBEAT_NAMESPACE = 'heartbeat:' PROCESSOR_NAMESPACE = 'processor:' - HEARTBEAT_TTL = 90 - REFRESH_TIMEOUT = 60 + HEARTBEAT_TTL = 18 + REFRESH_TIMEOUT = 10 def start!(ttl=HEARTBEAT_TTL, timeout=REFRESH_TIMEOUT) Thread.new do loop do update_heartbeat ttl @@ -20,12 +20,14 @@ private def update_heartbeat(ttl) Sidekiq.redis do |it| - it.set processor_key, true - it.set heartbeat_key, true - it.expire heartbeat_key, ttl + it.pipelined do + it.set processor_key, true + it.set heartbeat_key, true + it.expire heartbeat_key, ttl + end end end def invalidate_old_processors Sidekiq.redis do |it|