lib/sidekiq/limit_fetch/global/semaphore.rb in sidekiq-limit_fetch-2.4.0 vs lib/sidekiq/limit_fetch/global/semaphore.rb in sidekiq-limit_fetch-2.4.1

- old
+ new

@@ -16,14 +16,20 @@ value = redis {|it| it.get "#{PREFIX}:limit:#@name" } value.to_i if value end def limit=(value) + @limit_changed = true + if value redis {|it| it.set "#{PREFIX}:limit:#@name", value } else redis {|it| it.del "#{PREFIX}:limit:#@name" } end + end + + def limit_changed? + @limit_changed end def process_limit value = redis {|it| it.get "#{PREFIX}:process_limit:#@name" } value.to_i if value