Skip to content
Snippets Groups Projects
Commit 67a61c80 authored by Pierre GUINOISEAU's avatar Pierre GUINOISEAU
Browse files

Allow connection to Redis via unix socket

Allow connection to Redis via unix socket, using
unix:/var/run/redis/redis.sock for example.

Default behaviour does not change, except that the full Redis URL must
be configured, with redis:// for tcp or unix: for unix socket.
parent 7b38a0de
No related branches found
No related tags found
No related merge requests found
Loading
@@ -4,19 +4,19 @@ config_file = Rails.root.join('config', 'resque.yml')
Loading
@@ -4,19 +4,19 @@ config_file = Rails.root.join('config', 'resque.yml')
resque_url = if File.exists?(config_file) resque_url = if File.exists?(config_file)
YAML.load_file(config_file)[Rails.env] YAML.load_file(config_file)[Rails.env]
else else
"localhost:6379" "redis://localhost:6379"
end end
   
Sidekiq.configure_server do |config| Sidekiq.configure_server do |config|
config.redis = { config.redis = {
url: "redis://#{resque_url}", url: resque_url,
namespace: 'resque:gitlab' namespace: 'resque:gitlab'
} }
end end
   
Sidekiq.configure_client do |config| Sidekiq.configure_client do |config|
config.redis = { config.redis = {
url: "redis://#{resque_url}", url: resque_url,
namespace: 'resque:gitlab' namespace: 'resque:gitlab'
} }
end end
development: localhost:6379 development: redis://localhost:6379
test: localhost:6379 test: redis://localhost:6379
production: redis.example.com:6379 production: redis://redis.example.com:6379
Loading
@@ -288,7 +288,7 @@ a different host, you can configure its connection string via the
Loading
@@ -288,7 +288,7 @@ a different host, you can configure its connection string via the
`config/resque.yml` file. `config/resque.yml` file.
   
# example # example
production: redis.example.tld:6379 production: redis://redis.example.tld:6379
   
## Custom SSH Connection ## Custom SSH Connection
   
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment