Commit bd778fbd authored by Gabriel Mazetto's avatar Gabriel Mazetto

Make sure NotifyNodesService doesn't fail silently

parent facffd59
......@@ -50,7 +50,7 @@ class GeoNode < ActiveRecord::Base
end
def notify_url
URI::join(uri, "#{uri.path}/", 'api/geo/refresh_projects').to_s
URI::join(uri, "#{uri.path}/", 'api/v3/geo/refresh_projects').to_s
end
private
......
......@@ -39,12 +39,12 @@ module Geo
private
def notify_updated_projects(node, projects)
self.class.post(node.notify_url,
body: { projects: projects }.to_json,
headers: {
'Content-Type' => 'application/json',
'PRIVATE-TOKEN' => private_token
})
response = self.class.post(node.notify_url,
body: { projects: projects }.to_json,
headers: {
'Content-Type' => 'application/json',
'PRIVATE-TOKEN' => private_token
})
return [(response.code >= 200 && response.code < 300), ActionView::Base.full_sanitizer.sanitize(response.to_s)]
rescue HTTParty::Error, Errno::ECONNREFUSED => e
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment