mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 18:26:06 +02:00
added logging
This commit is contained in:
parent
77b99b3d2e
commit
649d355972
1 changed files with 10 additions and 1 deletions
|
@ -4,7 +4,16 @@ class BouncedEmailsCleanerJob < ApplicationJob
|
|||
def perform
|
||||
BouncedMailAddress.find_each do |bounce|
|
||||
count = Contact.where(email: bounce.email).count
|
||||
bounce.destroy if count.zero?
|
||||
if count.zero?
|
||||
logger.info "#{bounce.inspect} ARE DELETED!"
|
||||
bounce.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def logger
|
||||
@logger ||= Logger.new(Rails.root.join('log', 'deleted_bounced_mails.log'))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue