remove REDISTOGO_URL deprecation
This commit is contained in:
parent
e0fdfdb0fa
commit
d68c1ad974
4 changed files with 10 additions and 35 deletions
|
|
@ -193,8 +193,6 @@ defaults:
|
||||||
scope: tags
|
scope: tags
|
||||||
include_user_tags: false
|
include_user_tags: false
|
||||||
pod_tags:
|
pod_tags:
|
||||||
# List valid environment variables
|
|
||||||
redistogo_url:
|
|
||||||
|
|
||||||
development:
|
development:
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -243,6 +241,7 @@ integration1:
|
||||||
integration2:
|
integration2:
|
||||||
environment:
|
environment:
|
||||||
url: 'http://localhost:34658/'
|
url: 'http://localhost:34658/'
|
||||||
|
redis: 'redis://localhost:6380'
|
||||||
single_process_mode: true
|
single_process_mode: true
|
||||||
assets:
|
assets:
|
||||||
serve: true
|
serve: true
|
||||||
|
|
|
||||||
|
|
@ -669,8 +669,8 @@ configuration: ## Section
|
||||||
## to have them different in different environments.
|
## to have them different in different environments.
|
||||||
production: ## Section
|
production: ## Section
|
||||||
environment: ## Section
|
environment: ## Section
|
||||||
#redis_url: 'redis://production.example.org:6379'
|
#redis: 'redis://production.example.org:6379'
|
||||||
|
|
||||||
development: ## Section
|
development: ## Section
|
||||||
environment: ## Section
|
environment: ## Section
|
||||||
#redis_url: 'redis://production.example.org:6379'
|
#redis: 'redis://production.example.org:6379'
|
||||||
|
|
|
||||||
|
|
@ -102,25 +102,14 @@ module Configuration
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_redis_options
|
def get_redis_options
|
||||||
if redistogo_url.present?
|
redis_url = ENV["REDIS_URL"] || environment.redis.get
|
||||||
warn "WARNING: using the REDISTOGO_URL environment variable is deprecated, please use REDIS_URL now."
|
|
||||||
ENV['REDIS_URL'] = redistogo_url
|
return {} unless redis_url.present?
|
||||||
|
|
||||||
|
unless redis_url.start_with?("redis://", "unix:///")
|
||||||
|
warn "WARNING: Your redis url (#{redis_url}) doesn't start with redis:// or unix:///"
|
||||||
end
|
end
|
||||||
|
{url: redis_url}
|
||||||
redis_options = {}
|
|
||||||
|
|
||||||
redis_url = ENV['REDIS_URL'] || environment.redis.get
|
|
||||||
|
|
||||||
if ENV['RAILS_ENV']== 'integration2'
|
|
||||||
redis_options[:url] = "redis://localhost:6380"
|
|
||||||
elsif redis_url.present?
|
|
||||||
unless redis_url.start_with?("redis://") || redis_url.start_with?("unix:///")
|
|
||||||
warn "WARNING: Your redis url (#{redis_url}) doesn't start with redis:// or unix:///"
|
|
||||||
end
|
|
||||||
redis_options[:url] = redis_url
|
|
||||||
end
|
|
||||||
|
|
||||||
redis_options
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def sidekiq_log
|
def sidekiq_log
|
||||||
|
|
|
||||||
|
|
@ -152,19 +152,8 @@ describe Configuration::Methods do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#get_redis_options" do
|
describe "#get_redis_options" do
|
||||||
context "with REDISTOGO_URL set" do
|
|
||||||
before do
|
|
||||||
ENV["REDISTOGO_URL"] = "redis://myserver"
|
|
||||||
end
|
|
||||||
|
|
||||||
it "uses that" do
|
|
||||||
expect(@settings.get_redis_options[:url]).to match "myserver"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context "with REDIS_URL set" do
|
context "with REDIS_URL set" do
|
||||||
before do
|
before do
|
||||||
ENV["REDISTOGO_URL"] = nil
|
|
||||||
ENV["REDIS_URL"] = "redis://yourserver"
|
ENV["REDIS_URL"] = "redis://yourserver"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -175,7 +164,6 @@ describe Configuration::Methods do
|
||||||
|
|
||||||
context "with redis set" do
|
context "with redis set" do
|
||||||
before do
|
before do
|
||||||
ENV["REDISTOGO_URL"] = nil
|
|
||||||
ENV["REDIS_URL"] = nil
|
ENV["REDIS_URL"] = nil
|
||||||
@settings.environment.redis = "redis://ourserver"
|
@settings.environment.redis = "redis://ourserver"
|
||||||
end
|
end
|
||||||
|
|
@ -187,7 +175,6 @@ describe Configuration::Methods do
|
||||||
|
|
||||||
context "with a unix socket set" do
|
context "with a unix socket set" do
|
||||||
before do
|
before do
|
||||||
ENV["REDISTOGO_URL"] = nil
|
|
||||||
ENV["REDIS_URL"] = nil
|
ENV["REDIS_URL"] = nil
|
||||||
@settings.environment.redis = "unix:///tmp/redis.sock"
|
@settings.environment.redis = "unix:///tmp/redis.sock"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue