Class: PactBroker::Webhooks::Job

Inherits:
Object
  • Object
show all
Includes:
Logging, SuckerPunch::Job
Defined in:
lib/pact_broker/webhooks/job.rb

Constant Summary collapse

BACKOFF_TIMES =

10 sec, 1 min, 2 min, 5 min, 10 min, 20 min => 38 minutes

[10, 60, 120, 300, 600, 1200]

Constants included from Logging

Logging::LOG_DIR, Logging::LOG_FILE_NAME

Instance Method Summary collapse

Methods included from Logging

included, #log_error, #logger, #logger=

Instance Method Details

#perform(data) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/pact_broker/webhooks/job.rb', line 14

def perform data
  @webhook = data[:webhook]
  @error_count = data[:error_count] || 0
  begin
    webhook_execution_result = PactBroker::Webhooks::Service.execute_webhook_now webhook
    reschedule_job unless webhook_execution_result.success?
  rescue StandardError => e
    handle_error e
  end
end