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
e1f14449
Commit
e1f14449
authored
Feb 16, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Geo Notify redis operations
parent
5ea39b1c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
app/services/geo/notify_nodes_service.rb
app/services/geo/notify_nodes_service.rb
+9
-9
No files found.
app/services/geo/notify_nodes_service.rb
View file @
e1f14449
...
...
@@ -24,13 +24,13 @@ module Geo
projects
=
[]
@redis
.
multi
do
projects
=
@redis
.
lrange
(
QUEUE
,
0
,
batch_size
-
1
)
@redis
.
ltrim
(
QUEUE
,
0
,
batch_size
-
1
)
@redis
.
ltrim
(
QUEUE
,
batch_size
,
-
1
)
end
::
Gitlab
::
Geo
.
secondary_nodes
.
each
do
|
node
|
success
,
message
=
notify_updated_projects
(
node
,
projects
.
value
)
unless
success
Rails
.
logger
.
error
(
"Gitlab Failed to notify
#{
node
.
url
}
:
#{
message
}
"
)
Rails
.
logger
.
error
(
"Gitlab Failed to notify
#{
node
.
url
}
:
#{
message
}
"
)
reenqueue_projects
(
projects
.
value
)
end
end
...
...
@@ -39,7 +39,7 @@ module Geo
private
def
notify_updated_projects
(
node
,
projects
)
self
.
post
(
node
.
notify_url
,
self
.
class
.
post
(
node
.
notify_url
,
body:
{
projects:
projects
}.
to_json
,
headers:
{
'Content-Type'
=>
'application/json'
,
...
...
@@ -47,7 +47,7 @@ module Geo
})
return
[(
response
.
code
>=
200
&&
response
.
code
<
300
),
ActionView
::
Base
.
full_sanitizer
.
sanitize
(
response
.
to_s
)]
rescue
HTTParty
::
Error
=>
e
rescue
HTTParty
::
Error
,
Errno
::
ECONNREFUSED
=>
e
return
[
false
,
ActionView
::
Base
.
full_sanitizer
.
sanitize
(
e
.
message
)]
end
...
...
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