2019-02-28 15:22:21 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
class FetchReplyWorker
|
|
|
|
|
include Sidekiq::Worker
|
|
|
|
|
include ExponentialBackoff
|
|
|
|
|
|
|
|
|
|
sidekiq_options queue: 'pull', retry: 3
|
|
|
|
|
|
2023-02-10 22:16:37 +01:00
|
|
|
def perform(child_url, options = {})
|
2025-07-29 12:47:18 +02:00
|
|
|
batch = WorkerBatch.new(options.delete('batch_id')) if options['batch_id']
|
|
|
|
|
result = FetchRemoteStatusService.new.call(child_url, **options.symbolize_keys)
|
2025-07-23 15:42:07 +02:00
|
|
|
ensure
|
2025-08-04 14:49:17 +02:00
|
|
|
batch&.remove_job(jid, increment: result&.previously_new_record?)
|
2019-02-28 15:22:21 +01:00
|
|
|
end
|
|
|
|
|
end
|