Class: Webhookdb::Jobs::IcalendarSync

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

Instance Method Summary collapse

Methods included from Async::Job

extended

Instance Method Details

#perform(sint_id, calendar_external_id) ⇒ Object



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

def perform(sint_id, calendar_external_id)
  sint = self.lookup_model(Webhookdb::ServiceIntegration, sint_id)
  self.with_log_tags(sint.log_tags.merge(calendar_external_id:)) do
    row = sint.replicator.admin_dataset { |ds| ds[external_id: calendar_external_id] }
    if row.nil?
      self.logger.warn("icalendar_sync_row_miss", calendar_external_id:)
      return
    end
    self.logger.debug("icalendar_sync_start")
    sint.replicator.sync_row(row)
  end
end