Module: Sidekiq::History

Defined in:
lib/sidekiq/history.rb,
lib/sidekiq/history/version.rb,
lib/sidekiq/history/middleware.rb,
lib/sidekiq/history/web_extension.rb

Defined Under Namespace

Modules: WebExtension Classes: HistorySet, Middleware

Constant Summary collapse

LIST_KEY =
:history
VERSION =
'0.0.13'.freeze

Class Method Summary collapse

Class Method Details

.countObject



59
60
61
# File 'lib/sidekiq/history.rb', line 59

def self.count
  Sidekiq.redis { |r| r.zcard(LIST_KEY) }
end

.reset_history(options = {}) ⇒ Object



50
51
52
53
54
55
56
57
# File 'lib/sidekiq/history.rb', line 50

def self.reset_history(options = {})
  Sidekiq.redis do |c|
    c.multi do
      c.del(LIST_KEY)
      c.set('stat:history', 0) if options[:counter] || options['counter']
    end
  end
end