Class: Webhookdb::Jobs::RenewWatchChannel

Inherits:
Object
  • Object
show all
Extended by:
Async::Job
Includes:
Amigo::QueueBackoffJob
Defined in:
lib/webhookdb/jobs/renew_watch_channel.rb

Overview

Generic helper to renew watch channels, enqueued by replicator-specific jobs like RenewGoogleWatchChannels. Must be emitted with [service_integration_id, expirng_before:] Calls #renew_watch_channel(row_pk:, expiring_before:).

Instance Method Summary collapse

Methods included from Async::Job

extended

Instance Method Details

#perform(service_integration_id, renew_watch_criteria) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/webhookdb/jobs/renew_watch_channel.rb', line 17

def perform(service_integration_id, renew_watch_criteria)
  sint = self.lookup_model(Webhookdb::ServiceIntegration, service_integration_id)
  self.set_job_tags(sint.log_tags)
  row_pk = renew_watch_criteria.fetch("row_pk")
  expiring_before = Time.parse(renew_watch_criteria.fetch("expiring_before"))
  sint.replicator.renew_watch_channel(row_pk:, expiring_before:)
end