Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
bd778fbd
Commit
bd778fbd
authored
Feb 29, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure NotifyNodesService doesn't fail silently
parent
facffd59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
app/models/geo_node.rb
app/models/geo_node.rb
+1
-1
app/services/geo/notify_nodes_service.rb
app/services/geo/notify_nodes_service.rb
+6
-6
No files found.
app/models/geo_node.rb
View file @
bd778fbd
...
...
@@ -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
...
...
app/services/geo/notify_nodes_service.rb
View file @
bd778fbd
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment