Class: Webhooks::CallbackUrlJob

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Job
Defined in:
app/sidekiq/webhooks/callback_url_job.rb

Constant Summary collapse

MAX_BODY_LENGTH =

denotes the how large of a body from the client url we record in our db.

500

Instance Method Summary collapse

Instance Method Details

#perform(url, ids, max_retries) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/sidekiq/webhooks/callback_url_job.rb', line 9

def perform(url, ids, max_retries)
  @url = url
  @ids = ids
  @max_retries = max_retries
  r = Webhooks::Notification.where(id: ids)
  @msg = { 'notifications' => [] }
  r.each do |notification|
    @msg['notifications'] << notification.msg
  end
  Rails.logger.info "Webhooks::CallbackUrlJob Notifying on callback url #{url} for ids #{ids} with msg #{@msg}"
  notify
end