Class: AuctionFunCore::Workers::ApplicationJob Abstract

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Job
Defined in:
lib/auction_fun_core/workers/application_job.rb

Overview

This class is abstract.

Abstract base class for background jobs.

Constant Summary collapse

MAX_RETRIES =
15

Instance Method Summary collapse

Instance Method Details

#backoff_exponential_job(retry_count, measure = "seconds") ⇒ Object



15
16
17
18
19
# File 'lib/auction_fun_core/workers/application_job.rb', line 15

def backoff_exponential_job(retry_count, measure = "seconds")
  max_retries = Float(2**retry_count)

  rand(0..max_retries).send(measure)
end

#capture_exception(exception, attributes = {}) ⇒ Object



11
12
13
# File 'lib/auction_fun_core/workers/application_job.rb', line 11

def capture_exception(exception, attributes = {})
  Application[:logger].error("#{exception.message}. Parameters: #{attributes}")
end