mirror of
https://github.com/Evolix/chexpire.git
synced 2024-06-26 19:12:53 +02:00
19 lines
512 B
Ruby
19 lines
512 B
Ruby
|
class ResyncJob < ApplicationJob
|
||
|
queue_as :default
|
||
|
|
||
|
rescue_from ActiveRecord::RecordNotFound do
|
||
|
raise if attempt_number == 5 # rubocop:disable Style/SignalException
|
||
|
|
||
|
# at job creation, the db could not return immediately the check
|
||
|
# we have to wait a few (milli)-seconds
|
||
|
retry_job(wait: attempt_number**2)
|
||
|
end
|
||
|
|
||
|
def perform(check_id)
|
||
|
check = Check.find(check_id)
|
||
|
|
||
|
WhoisSyncJob.perform_later(check_id) if check.domain?
|
||
|
SSLSyncJob.perform_later(check_id) if check.ssl?
|
||
|
end
|
||
|
end
|