Class: AuctionFunCore::Workers::ApplicationJob Abstract
- Inherits:
-
Object
- Object
- AuctionFunCore::Workers::ApplicationJob
- Includes:
- Sidekiq::Job
- Defined in:
- lib/auction_fun_core/workers/application_job.rb
Overview
This class is abstract.
Abstract base class for background jobs.
Direct Known Subclasses
Operations::AuctionContext::Processor::FinishOperationJob, Operations::AuctionContext::Processor::StartOperationJob, Services::Mail::UserContext::RegistrationMailerJob
Constant Summary collapse
- MAX_RETRIES =
15
Instance Method Summary collapse
- #backoff_exponential_job(retry_count, measure = "seconds") ⇒ Object
- #capture_exception(exception, attributes = {}) ⇒ Object
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.}. Parameters: #{attributes}") end |