Class: RailsExecution::Services::RemoveScheduledJob

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_execution/services/remove_scheduled_job.rb

Instance Method Summary collapse

Constructor Details

#initialize(task) ⇒ RemoveScheduledJob

Returns a new instance of RemoveScheduledJob.



5
6
7
# File 'lib/rails_execution/services/remove_scheduled_job.rb', line 5

def initialize(task)
  @task = task
end

Instance Method Details

#callObject



9
10
11
12
13
# File 'lib/rails_execution/services/remove_scheduled_job.rb', line 9

def call
  return if task.jid.blank?

  task.update(jid: nil) if ::RailsExecution.configuration.scheduled_task_remover.call(task.jid)
end