Class: Spree::BaseJob
- Inherits:
-
ApplicationJob
- Object
- ApplicationJob
- Spree::BaseJob
- Defined in:
- app/jobs/spree/base_job.rb
Overview
Shared base for every Spree job.
Retries only transient infrastructure errors. Broad replay is unsafe here because
most jobs have non-idempotent post-work side effects (counters, state transitions,
lifecycle events, external calls); jobs whose work is retry-safe opt in to
retry_on StandardError themselves (see Spree::WebhookDeliveryJob,
Spree::Events::SubscriberJob). RecordNotFound gets its own tighter policy
to absorb the Sidekiq enqueue-vs-DB-commit race (sub-second window) without
holding the queue for genuine deletes.
Direct Known Subclasses
Addresses::GeocodeAddressJob, Carts::ReapExpiredJob, Collections::RegenerateTimeBasedJob, CouponCodes::BulkGenerateJob, DataRequests::ProcessJob, Events::SubscriberJob, Exports::GenerateJob, GiftCards::BulkGenerateJob, GiftCards::PublishCreatedEventsJob, Images::MigrateProductMediaJob, Images::SaveFromUrlJob, Imports::BaseJob, MaintenanceTasks::RunJob, Orders::FinalizeStaleDraftsJob, Payments::CancelUnusedSessionsJob, Payments::HandleModificationWebhookJob, Payments::HandleWebhookJob, PriceLists::SyncCurrenciesJob, ProductTypes::ApplyToProductsJob, Products::AutoMatchCollectionsJob, Products::RefreshMetricsJob, SampleData::LoadJob, SearchProvider::IndexJob, SearchProvider::RemoveJob, SellerPayouts::SweepDueJob, SellerPayouts::SweepSellerJob, SellerTransfers::ExecutePendingDueJob, SellerTransfers::ExecutePendingJob, ShippingLabels::StoreFileJob, StockLocations::StockLevels::CreateJob, StockReservations::ExpireJob, TaxIdentifiers::ValidateJob, Uploads::PurgeUnattachedJob, Variants::RemoveFromIncompleteOrdersJob, Variants::RemoveLineItemJob, Variants::TouchJob
Constant Summary collapse
- TRANSIENT_ERRORS =
Infrastructure errors that clear up on their own, so every job retries them.
[ ActiveRecord::Deadlocked, ActiveRecord::LockWaitTimeout, ActiveRecord::ConnectionNotEstablished, ActiveRecord::ConnectionFailed ].freeze