Class: Webhookdb::Jobs::IcalendarEnqueueSyncs

Inherits:
Object
  • Object
show all
Extended by:
Async::ScheduledJob
Defined in:
lib/webhookdb/jobs/icalendar_enqueue_syncs.rb

Instance Method Summary collapse

Methods included from Async::ScheduledJob

extended

Instance Method Details

#_performObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/webhookdb/jobs/icalendar_enqueue_syncs.rb', line 12

def _perform
  Webhookdb::ServiceIntegration.dataset.where_each(service_name: "icalendar_calendar_v1") do |sint|
    sint.replicator.admin_dataset do |ds|
      sint.replicator.rows_needing_sync(ds).each do |row|
        calendar_external_id = row.fetch(:external_id)
        self.with_log_tags(sint.log_tags) do
          enqueued_job_id = Webhookdb::Jobs::IcalendarSync.perform_async(sint.id, calendar_external_id)
          self.logger.info("enqueued_icalendar_sync", calendar_external_id:, enqueued_job_id:)
        end
      end
    end
  end
end