Sha256: 08528992cecbec801ab02d4de391d71f3aaa9609388367c2e40346709fb3fb7b

Contents?: true

Size: 537 Bytes

Versions: 22

Compression:

Stored size: 537 Bytes

Contents

# frozen_string_literal: true

Delayed::Worker.backend = :active_record

if Object.const_defined?("Postmark")
  class InvalidRecipientsPlugin < Delayed::Plugin
    callbacks do |lifecycle|
      lifecycle.around(:invoke_job) do |job, *args, &block|
        # Forward the call to the next callback in the callback chain
        block.call(job, *args)
      rescue Postmark::InactiveRecipientError => e
        Rails.logger.error "#{e.class}: #{e.message}"
      end
    end
  end

  Delayed::Worker.plugins << InvalidRecipientsPlugin
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
pages_core-3.12.7 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.12.6 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.12.5 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.12.4 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.12.3 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.12.2 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.12.1 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.12.0 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.11.3 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.11.2 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.11.1 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.11.0 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.10.2 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.10.1 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.9.2 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.9.1 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.9.0 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.8.3 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.8.2 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb
pages_core-3.8.1 lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb