lib/sidekiq/limit_fetch/global/semaphore.rb in sidekiq-limit_fetch-2.0.2 vs lib/sidekiq/limit_fetch/global/semaphore.rb in sidekiq-limit_fetch-2.1.0
- old
+ new
@@ -19,9 +19,18 @@
def limit=(value)
redis {|it| it.set "#{PREFIX}:limit:#@name", value }
end
+ def process_limit
+ value = redis {|it| it.get "#{PREFIX}:process_limit:#@name" }
+ value.to_i if value
+ end
+
+ def process_limit=(value)
+ redis {|it| it.set "#{PREFIX}:process_limit:#@name", value }
+ end
+
def acquire
Selector.acquire([@name], determine_namespace).size > 0
end
def release