Class: SolidQueue::FailedExecution

Inherits:
Execution show all
Includes:
Dispatching
Defined in:
app/models/solid_queue/failed_execution.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Execution

create_all_from_jobs, #discard, discard_all_from_jobs, discard_all_in_batches, execution_data_from_jobs, type, #type

Methods inherited from Record

non_blocking_lock

Instance Attribute Details

#exceptionObject

Returns the value of attribute exception.



11
12
13
# File 'app/models/solid_queue/failed_execution.rb', line 11

def exception
  @exception
end

Class Method Details

.retry_all(jobs) ⇒ Object



13
14
15
16
17
18
19
# File 'app/models/solid_queue/failed_execution.rb', line 13

def self.retry_all(jobs)
  SolidQueue.instrument(:retry_all, jobs_size: jobs.size) do |payload|
    transaction do
      payload[:size] = dispatch_jobs lock_all_from_jobs(jobs)
    end
  end
end

Instance Method Details

#retryObject



21
22
23
24
25
26
27
28
29
# File 'app/models/solid_queue/failed_execution.rb', line 21

def retry
  SolidQueue.instrument(:retry, job_id: job.id) do
    with_lock do
      job.reset_execution_counters
      job.prepare_for_execution
      destroy!
    end
  end
end