lib/sidekiq/expected_failures.rb in sidekiq-expected_failures-0.3.0 vs lib/sidekiq/expected_failures.rb in sidekiq-expected_failures-0.4.0

- old
+ new

@@ -1,21 +1,19 @@ require "sidekiq/expected_failures/version" require "sidekiq/expected_failures/middleware" module Sidekiq - def self.expected_failures=(exceptions) @expected_failures = exceptions end def self.expected_failures @expected_failures || {} end module ExpectedFailures - def self.dates Sidekiq.redis do |c| c.smembers "expected:dates" end.sort.reverse.each_with_object({}) do |d, hash| hash[d] = Sidekiq.redis { |c| c.llen("expected:#{d}") } @@ -39,19 +37,19 @@ Sidekiq.redis { |r| r.del("expected:count") } end private - def self.clear(dates) - dates.each do |date| - Sidekiq.redis do |c| - c.multi do |m| - m.srem("expected:dates", date) - m.del("expected:#{date}") - end + def self.clear(dates) + dates.each do |date| + Sidekiq.redis do |c| + c.multi do |m| + m.srem("expected:dates", date) + m.del("expected:#{date}") end end end + end end end Sidekiq.configure_server do |config| config.server_middleware do |chain|