Class: AdsActionItemSyncWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Job
Defined in:
app/workers/ads_action_item_sync_worker.rb

Overview

Reconciles AdActionItem rows against the current numbers via
Marketing::Ads::ActionItemSync. Scheduled 30 minutes after
AdSpendSyncWorker so the rules measure a window that already includes
yesterday.

Reads already-synced data only — no ad-platform API calls — so it's cheap and
safe to retry.

Instance Method Summary collapse

Instance Method Details

#performvoid

This method returns an undefined value.



18
19
20
21
22
23
24
25
26
# File 'app/workers/ads_action_item_sync_worker.rb', line 18

def perform
  # Serialize runs so an overlapping schedule, retry, or manual enqueue can't
  # double-reconcile the same campaigns (matches ListingIssueSyncWorker). A
  # skipped run is harmless — the next one reconciles.
  AdActionItem.with_advisory_lock('ads_action_item_sync', timeout_seconds: 10) do
    result = Marketing::Ads::ActionItemSync.run(logger:)
    logger.info "[AdsActionItemSyncWorker] complete: #{result.to_h}"
  end
end