Method: Webhookdb::Replicator::Base#_publish_rowupsert

Defined in:
lib/webhookdb/replicator/base.rb

#_publish_rowupsert(row, check_for_subscriptions: true) ⇒ Object



722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
# File 'lib/webhookdb/replicator/base.rb', line 722

def _publish_rowupsert(row, check_for_subscriptions: true)
  return unless check_for_subscriptions && self._any_subscriptions_to_notify?
  payload = [
    self.service_integration.id,
    {
      row:,
      external_id_column: self._remote_key_column.name,
      external_id: row[self._remote_key_column.name],
    },
  ]
  # We AVOID pubsub here because we do NOT want to go through the router
  # and audit logger for this.
  event = Amigo::Event.create("webhookdb.serviceintegration.rowupsert", payload.as_json)
  Webhookdb::Jobs::SendWebhook.perform_async(event.as_json)
end