Class: SidekiqBulkJob::JobRetry
- Inherits:
-
Object
- Object
- SidekiqBulkJob::JobRetry
- Defined in:
- lib/sidekiq_bulk_job/job_retry.rb
Instance Method Summary collapse
-
#initialize(klass, error_handle, options = {}) ⇒ JobRetry
constructor
A new instance of JobRetry.
- #push(options = {}) ⇒ Object
Constructor Details
#initialize(klass, error_handle, options = {}) ⇒ JobRetry
Returns a new instance of JobRetry.
10 11 12 13 14 15 |
# File 'lib/sidekiq_bulk_job/job_retry.rb', line 10 def initialize(klass, error_handle, ={}) @handler = Sidekiq::JobRetry.new() @klass = klass @error_handle = error_handle @retry_count = 0 end |
Instance Method Details
#push(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/sidekiq_bulk_job/job_retry.rb', line 17 def push(={}) @retry_count = SidekiqBulkJob.redis.incr @error_handle.jid opts = () queue_as = queue(@klass) || :default begin @handler.local(SidekiqBulkJob::BulkJob, opts, queue_as) do raise @error_handle.raise_error end rescue Exception => e end end |