Class: ActivityPrioritizationWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Job, Workers::StatusBroadcastable
Defined in:
app/workers/activity_prioritization_worker.rb

Instance Attribute Summary

Attributes included from Workers::StatusBroadcastable

#broadcast_status_updates

Instance Method Summary collapse

Methods included from Workers::StatusBroadcastable::Overrides

#at, #store, #total

Instance Method Details

#perform(options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'app/workers/activity_prioritization_worker.rb', line 7

def perform(options = {})
  options = options.with_indifferent_access
  ap = Activity::Prioritizer.new(options).process do |num, reported_total, msg|
    reported_total ||= 0
    num ||= 0
    total reported_total
    at(num, "At #{num} of #{reported_total} - #{msg}")
  end
  store redirect_to: options[:redirect_to]
end