Class: Sidekiq::Tasks::Job

Inherits:
Object
  • Object
show all
Includes:
Job
Defined in:
lib/sidekiq/tasks/job.rb

Instance Method Summary collapse

Instance Method Details

#perform(name, args) ⇒ Object

Parameters:

  • name (String)

    The name of the task to execute.

  • args (Hash)

    The arguments to pass to the task.

Raises:

  • (Sidekiq::Tasks::TaskNotFoundError)

    If the task is not found.



13
14
15
16
# File 'lib/sidekiq/tasks/job.rb', line 13

def perform(name, args)
  symbolized_args = JSON.parse(args, symbolize_names: true)
  Sidekiq::Tasks.tasks.find_by!(name: name).execute(symbolized_args, jid: jid)
end