Class: WatCatcher::Poster

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
lib/wat_catcher/poster.rb

Instance Method Summary collapse

Instance Method Details

#perform(url, params) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/wat_catcher/poster.rb', line 6

def perform(url, params)
  HTTPClient.post_content(url,
                          body: params.to_json,
                          header: {"Content-Type" => "application/json; charset=utf-8"})
rescue => excpt
  Rails.logger.error( "WatCatcher::Poster error thrown by wat_catcher!: #{excpt.inspect}" )

  retry_job(wait: 10)
end