lib/sidekiq/limit_fetch/global/semaphore.rb in sidekiq-limit_fetch-4.3.2 vs lib/sidekiq/limit_fetch/global/semaphore.rb in sidekiq-limit_fetch-4.4.0
- old
+ new
@@ -75,27 +75,27 @@
def probed_processes
redis {|it| it.lrange "#{PREFIX}:probed:#@name", 0, -1 }
end
def pause
- redis {|it| it.set "#{PREFIX}:pause:#@name", true }
+ redis {|it| it.set "#{PREFIX}:pause:#@name", '1' }
end
def pause_for_ms ms
- redis {|it| it.psetex "#{PREFIX}:pause:#@name", ms, true }
+ redis {|it| it.psetex "#{PREFIX}:pause:#@name", ms, 1 }
end
def unpause
redis {|it| it.del "#{PREFIX}:pause:#@name" }
end
def paused?
- redis {|it| it.get "#{PREFIX}:pause:#@name" }
+ redis {|it| it.get "#{PREFIX}:pause:#@name" } == '1'
end
def block
- redis {|it| it.set "#{PREFIX}:block:#@name", true }
+ redis {|it| it.set "#{PREFIX}:block:#@name", '1' }
end
def block_except(*queues)
raise ArgumentError if queues.empty?
redis {|it| it.set "#{PREFIX}:block:#@name", queues.join(',') }
@@ -104,10 +104,10 @@
def unblock
redis {|it| it.del "#{PREFIX}:block:#@name" }
end
def blocking?
- redis {|it| it.get "#{PREFIX}:block:#@name" }
+ redis {|it| it.get "#{PREFIX}:block:#@name" } == '1'
end
def clear_limits
redis do |it|
%w(block busy limit pause probed process_limit).each do |key|