class LessRetryableWorker
include Sidekiq::Worker
sidekiq_options :retry => 5 # Only five retries and then to the Dead Job Queue
def perform(...)
end
end
unless Rails.application.config.consider_all_requests_local
rescue_from Exception, with: :respond_with_500
rescue_from ActiveRecord::RecordNotFound,
ActionController::RoutingError,
ActiveRecord::RecordInvalid,
with: :respond_with_404
rescue_from ActionController::BadRequest, with: :respond_with_400
end
def respond_with_404(exception=nil)
redirect_to root_path
end