fixed looping validation email

This commit is contained in:
olegphenomenon 2022-05-18 16:23:28 +03:00
parent c53bb42976
commit 5324a99ea4
2 changed files with 12 additions and 5 deletions

View file

@ -37,11 +37,18 @@ module Actions
end
def maybe_filtering_old_failed_records
validation_events = contact.validation_events
return unless validation_events.count > 1
# validation_events = contact.validation_events
# return unless validation_events.count > 1
validation_events.order!(created_at: :asc)
validation_events.first.destroy while validation_events.count >= 1
# validation_events.order!(created_at: :asc)
# validation_events.first.destroy while validation_events.count >= 1
if contact.validation_events.count > 1
contact.validation_events.order!(created_at: :asc)
while contact.validation_events.count >= 1
contact.validation_events.first.destroy
end
end
end
def maybe_remove_address

View file

@ -4,7 +4,7 @@ require 'syslog/logger'
require 'active_record'
namespace :verify_email do
# bundle exec rake verify_email:check_all -- --domain_name=shop.test --check_level=mx --spam_protect=true
# bundle exec rake verify_email:check_all -- --check_level=mx --spam_protect=true
# bundle exec rake verify_email:check_all -- -dshop.test -cmx -strue
desc 'Starts verifying email jobs with optional check level and spam protection'
task check_all: :environment do