Sha256: 8fe4c38b28336642e57f40b50ded6222c4dc2601c85dc7fb572d1f2dd26b525b

Contents?: true

Size: 437 Bytes

Versions: 1

Compression:

Stored size: 437 Bytes

Contents

module Georgia
  module Mailer
    class DestroyAllSpamWorker
      include SuckerPunch::Job

      def perform
        ActiveRecord::Base.connection_pool.with_connection do
          begin
            Message.destroy_all(spam: true)
          rescue ActiveRecord::RecordNotFound
            Rails.logger.info "Message with ID #{message_id} was destroy before it could be processed"
          end
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
georgia_mailer-0.8.0 app/workers/georgia/mailer/destroy_all_spam_worker.rb