FIX: log when push notifications fail

This commit is contained in:
Sam 2017-06-30 10:45:53 -04:00
parent 16d356ab4e
commit 5c89a37ceb
1 changed files with 6 additions and 1 deletions

View File

@ -20,10 +20,15 @@ module Jobs
})
end
Excon.post(push_url,
result = Excon.post(push_url,
body: payload.merge(notifications: notifications).to_json,
headers: { 'Content-Type' => 'application/json', 'Accept' => 'application/json' }
)
if result.status != 200
# we failed to push a notification ... log it
Rails.logger.warn("Failed to push a notification to #{push_url} Status: #{result.status}: #{result.status_line}")
end
end
end