-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AO3-6706 Support Sentinel config for Redis clients (#4787)
* AO3-6706 Support Sentinel config for Redis clients * Fix examples
- Loading branch information
1 parent
00a6ac2
commit 2254624
Showing
2 changed files
with
37 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
require 'resque' | ||
require "resque" | ||
|
||
rails_root = ENV["RAILS_ROOT"] || File.dirname(__FILE__) + "/../../.." | ||
rails_env = ENV["RAILS_ENV"] || "development" | ||
rails_root = ENV["RAILS_ROOT"] || "#{File.dirname(__FILE__)}/../../.." | ||
rails_env = (ENV["RAILS_ENV"] || "development").to_sym | ||
|
||
redis_configs = YAML.load_file(rails_root + '/config/redis.yml') | ||
Resque.redis = redis_configs['redis_resque'][rails_env] | ||
redis_configs = YAML.load_file("#{rails_root}/config/redis.yml", symbolize_names: true) | ||
Resque.redis = redis_configs[:redis_resque][rails_env] | ||
|
||
# in-process performing of jobs (for testing) doesn't require a redis server | ||
Resque.inline = ENV['RAILS_ENV'] == "test" | ||
# in-process performing of jobs (for testing) doesn't require a redis server | ||
Resque.inline = ENV["RAILS_ENV"] == "test" | ||
|
||
Resque.after_fork do | ||
Resque.redis.client.reconnect | ||
end | ||
Resque.after_fork do | ||
Resque.redis.client.reconnect | ||
end |