Destroy validation events before job

This commit is contained in:
Thiago Youssef 2022-05-19 09:15:53 +03:00
parent 4dcd6d765c
commit de53f0422f

View file

@ -18,13 +18,12 @@ namespace :verify_email do
options = RakeOptionParserBoilerplate.process_args(options: options, options = RakeOptionParserBoilerplate.process_args(options: options,
banner: banner, banner: banner,
hash: opts_hash) hash: opts_hash)
ValidationEvent.old_records.destroy_all
email_contacts = prepare_contacts(options) email_contacts = prepare_contacts(options)
email_contacts.each do |email| email_contacts.each do |email|
VerifyEmailsJob.set(wait_until: spam_protect_timeout(options)) VerifyEmailsJob.set(wait_until: spam_protect_timeout(options))
.perform_later(email: email, check_level: check_level(options)) .perform_later(email: email, check_level: check_level(options))
end end
ValidationEvent.old_records.destroy_all
end end
end end