Class: ActiveInteraction::ActiveJob::Sidekiq::ConfiguredJob

Inherits:
ActiveJob::ConfiguredJob
  • Object
show all
Defined in:
lib/active_interaction/active_job/sidekiq/configured_job.rb

Instance Method Summary collapse

Instance Method Details

#perform_later(*args) ⇒ Object Also known as: run!, run



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/active_interaction/active_job/sidekiq/configured_job.rb', line 6

def perform_later(*args)
  args = ActiveJob::Arguments.serialize(args)
  scope = @job_class.set(@options.except(:wait, :wait_until))

  if @job_class.sidekiq_options['encrypt']
    args.prepend(nil)
  end

  if @options[:wait]
    scope.perform_in @options[:wait], *args
  elsif @options[:wait_until]
    scope.perform_at @options[:wait_until], *args
  else
    scope.perform_async *args
  end
end

#perform_now(*args) ⇒ Object



2
3
4
# File 'lib/active_interaction/active_job/sidekiq/configured_job.rb', line 2

def perform_now(*args)
  @job_class.run!(*args)
end