Class: Webhookdb::Jobs::DemoModeSyncData

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

Instance Method Summary collapse

Methods included from Async::Job

extended

Instance Method Details

#_perform(event) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/webhookdb/jobs/demo_mode_sync_data.rb', line 10

def _perform(event)
  org = self.lookup_model(Webhookdb::Organization, event)
  if org.admin_connection_url.blank?
    # If PrepareDatabaseConnections hasn't run, we can't sync yet.
    # Retry every 1 second for a couple minutes until we have a database.
    raise Amigo::Retry::OrDie.new(120, 1)
  end
  Webhookdb::DemoMode.sync_demo_data(org)
end