Class: Sidekiq::Batch::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/sidekiq_pro/batches.rb

Instance Method Summary collapse

Constructor Details

#initialize(bid) ⇒ Status

Returns a new instance of Status.



190
191
192
193
194
195
196
197
198
199
200
# File 'lib/rspec/sidekiq_pro/batches.rb', line 190

def initialize(bid)
  if Sidekiq::Testing.disabled?
    super
  else
    @bid = bid
    @props = RSpec::SidekiqPro::Batches::Props.fetch(bid, {})
    @total = @props.fetch("jids", []).size
    @pending = @props.fetch("pending", @total)
    @failures = @props.fetch("failures", 0)
  end
end

Instance Method Details

#failures=(count) ⇒ Object



206
207
208
# File 'lib/rspec/sidekiq_pro/batches.rb', line 206

def failures=(count)
  RSpec::SidekiqPro::Batches::Props[@bid]["failures"] = count
end

#pending=(count) ⇒ Object



202
203
204
# File 'lib/rspec/sidekiq_pro/batches.rb', line 202

def pending=(count)
  RSpec::SidekiqPro::Batches::Props[@bid]["pending"] = count
end