Move jobs from Que to ActiveJob

This commit is contained in:
Alex Sherman 2020-10-19 16:01:20 +05:00
parent 1d3be40e14
commit 313731232e
53 changed files with 390 additions and 157 deletions

View file

@ -4,7 +4,7 @@ namespace :verify_email do
verifications_by_domain = EmailAddressVerification.not_verified_recently.group_by(&:domain)
verifications_by_domain.each do |_domain, verifications|
ver = verifications.sample # Verify random email to not to clog the SMTP servers
VerifyEmailsJob.enqueue(ver.id)
VerifyEmailsJob.perform_later(ver.id)
next
end
end
@ -18,6 +18,6 @@ namespace :verify_email do
verifications_by_domain = EmailAddressVerification.not_verified_recently
.by_domain(args[:domain_name])
verifications_by_domain.map { |ver| VerifyEmailsJob.enqueue(ver.id) }
verifications_by_domain.map { |ver| VerifyEmailsJob.perform_later(ver.id) }
end
end