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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
3a93bae2
Commit
3a93bae2
authored
Jul 12, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Few minor fixes to Redis params order and commented out sentinel config
in resque.yml.example Codestyle changes
parent
67ae8adc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
23 deletions
+23
-23
config/resque.yml.example
config/resque.yml.example
+16
-16
lib/gitlab/mail_room.rb
lib/gitlab/mail_room.rb
+0
-1
lib/gitlab/redis.rb
lib/gitlab/redis.rb
+7
-6
No files found.
config/resque.yml.example
View file @
3a93bae2
...
@@ -3,13 +3,13 @@
...
@@ -3,13 +3,13 @@
#
#
development:
development:
url: redis://localhost:6379
url: redis://localhost:6379
sentinels:
#
sentinels:
-
#
-
host: localhost
#
host: localhost
port: 26380 # point to sentinel, not to redis port
#
port: 26380 # point to sentinel, not to redis port
-
#
-
host: slave2
#
host: slave2
port: 26381 # point to sentinel, not to redis port
#
port: 26381 # point to sentinel, not to redis port
test:
test:
url: redis://localhost:6379
url: redis://localhost:6379
production:
production:
...
@@ -18,17 +18,17 @@ production:
...
@@ -18,17 +18,17 @@ production:
##
##
# Redis + Sentinel (for HA)
# Redis + Sentinel (for HA)
#
#
# Please read instructions carefully before using it as you may lo
o
se data:
# Please read instructions carefully before using it as you may lose data:
# http://redis.io/topics/sentinel
# http://redis.io/topics/sentinel
#
#
# You must specify a list of a few sentinels that will handle client connection
# You must specify a list of a few sentinels that will handle client connection
# please read here for more information: https://github.com/redis/redis-rb#sentinel-support
# please read here for more information: https://github.com/redis/redis-rb#sentinel-support
##
##
#url: redis://master:6379
#
url: redis://master:6379
#
sentinels:
# sentinels:
#
-
# -
#
host: slave1
# host: slave1
#
port: 26379 # point to sentinel, not to redis port
# port: 26379 # point to sentinel, not to redis port
#
-
# -
#
host: slave2
# host: slave2
#
port: 26379 # point to sentinel, not to redis port
# port: 26379 # point to sentinel, not to redis port
lib/gitlab/mail_room.rb
View file @
3a93bae2
...
@@ -4,7 +4,6 @@ require_relative 'redis' unless defined?(Gitlab::Redis)
...
@@ -4,7 +4,6 @@ require_relative 'redis' unless defined?(Gitlab::Redis)
module
Gitlab
module
Gitlab
module
MailRoom
module
MailRoom
class
<<
self
class
<<
self
def
enabled?
def
enabled?
config
[
:enabled
]
&&
config
[
:address
]
config
[
:enabled
]
&&
config
[
:address
]
...
...
lib/gitlab/redis.rb
View file @
3a93bae2
...
@@ -53,18 +53,19 @@ module Gitlab
...
@@ -53,18 +53,19 @@ module Gitlab
def
redis_store_options
def
redis_store_options
config
=
raw_config_hash
config
=
raw_config_hash
redis_url
=
config
.
delete
(
:url
)
redis_uri
=
URI
.
parse
(
redis_url
)
redis_uri
=
URI
.
parse
(
config
[
:url
])
if
redis_uri
.
scheme
==
'unix'
if
redis_uri
.
scheme
==
'unix'
# Redis::Store does not handle Unix sockets well, so let's do it for them
# Redis::Store does not handle Unix sockets well, so let's do it for them
config
[
:path
]
=
redis_uri
.
path
config
[
:path
]
=
redis_uri
.
path
config
else
else
redis_hash
=
::
Redis
::
Store
::
Factory
.
extract_host_options_from_uri
(
config
[
:url
])
redis_hash
=
::
Redis
::
Store
::
Factory
.
extract_host_options_from_uri
(
redis_url
)
config
.
merge!
(
redis_hash
)
# order is important here, sentinels must be after the connection keys.
# {url: ..., port: ..., sentinels: [...]}
redis_hash
.
merge
(
config
)
end
end
config
.
delete
(
:url
)
config
end
end
def
raw_config_hash
def
raw_config_hash
...
...
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