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
Abstract base class for background jobs.
Direct Known Subclasses
Operations::AuctionContext::PostAuction::ParticipantOperationJob, Operations::AuctionContext::PostAuction::WinnerOperationJob, Operations::AuctionContext::PreAuction::AuctionStartReminderOperationJob, Operations::AuctionContext::Processor::Finish::ClosedOperationJob, Operations::AuctionContext::Processor::Finish::PennyOperationJob, Operations::AuctionContext::Processor::Finish::StandardOperationJob, Operations::AuctionContext::Processor::StartOperationJob, Services::Mail::AuctionContext::PostAuction::ParticipantMailerJob, Services::Mail::AuctionContext::PostAuction::WinnerMailerJob, Services::Mail::AuctionContext::PreAuction::AuctionStartReminderMailerJob, Services::Mail::UserContext::RegistrationMailerJob
Constant Summary collapse
- MAX_RETRIES =
15
Instance Method Summary collapse
-
#backoff_exponential_job(retry_count, measure = "seconds") ⇒ Integer
Calculates an exponential backoff interval for retrying the job.
-
#capture_exception(exception, attributes = {}) ⇒ void
Captures an exception and logs it along with additional attributes.
Instance Method Details
#backoff_exponential_job(retry_count, measure = "seconds") ⇒ Integer
Calculates an exponential backoff interval for retrying the job.
27 28 29 30 31 |
# File 'lib/auction_fun_core/workers/application_job.rb', line 27 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 = {}) ⇒ void
This method returns an undefined value.
Captures an exception and logs it along with additional attributes.
18 19 20 |
# File 'lib/auction_fun_core/workers/application_job.rb', line 18 def capture_exception(exception, attributes = {}) Application[:logger].error("#{exception.}. Parameters: #{attributes}") end |