This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
2018-09-18 16:45:58 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class VerifyAccountLinksWorker
|
|
|
|
include Sidekiq::Worker
|
|
|
|
|
2023-10-03 10:09:00 +02:00
|
|
|
sidekiq_options queue: 'default', retry: false, lock: :until_executed, lock_ttl: 1.hour.to_i
|
2018-09-18 16:45:58 +02:00
|
|
|
|
|
|
|
def perform(account_id)
|
|
|
|
account = Account.find(account_id)
|
|
|
|
|
|
|
|
account.fields.each do |field|
|
2022-11-09 08:24:21 +01:00
|
|
|
VerifyLinkService.new.call(field) if field.requires_verification?
|
2018-09-18 16:45:58 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
account.save! if account.changed?
|
|
|
|
rescue ActiveRecord::RecordNotFound
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|