Add option to use native Ruby driver for Redis (#30717)
Some checks are pending
Check i18n / check-i18n (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (ruby) (push) Waiting to run
Check formatting / lint (push) Waiting to run
Ruby Linting / lint (push) Waiting to run
Historical data migration test / pre_job (push) Waiting to run
Historical data migration test / test (14-alpine) (push) Blocked by required conditions
Historical data migration test / test (15-alpine) (push) Blocked by required conditions
Ruby Testing / build (production) (push) Waiting to run
Ruby Testing / build (test) (push) Waiting to run
Ruby Testing / test (.ruby-version) (push) Blocked by required conditions
Ruby Testing / test (3.1) (push) Blocked by required conditions
Ruby Testing / test (3.2) (push) Blocked by required conditions
Ruby Testing / Libvips tests (.ruby-version) (push) Blocked by required conditions
Ruby Testing / Libvips tests (3.1) (push) Blocked by required conditions
Ruby Testing / Libvips tests (3.2) (push) Blocked by required conditions
Ruby Testing / End to End testing (.ruby-version) (push) Blocked by required conditions
Ruby Testing / End to End testing (3.1) (push) Blocked by required conditions
Ruby Testing / End to End testing (3.2) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:8.10.2) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, opensearchproject/opensearch:2) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (3.1, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (3.2, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions

This commit is contained in:
Michael Stanclift 2024-06-17 07:28:01 -05:00 committed by GitHub
parent d7b7617321
commit d5f02adad7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -42,9 +42,13 @@ class RedisConfiguration
ENV['REDIS_URL']
end
def redis_driver
ENV.fetch('REDIS_DRIVER', 'hiredis') == 'ruby' ? :ruby : :hiredis
end
private
def raw_connection
Redis.new(url: url, driver: :hiredis)
Redis.new(url: url, driver: redis_driver)
end
end

View File

@ -30,8 +30,10 @@ namespace = ENV.fetch('REDIS_NAMESPACE', nil)
cache_namespace = namespace ? "#{namespace}_cache" : 'cache'
sidekiq_namespace = namespace
redis_driver = ENV.fetch('REDIS_DRIVER', 'hiredis') == 'ruby' ? :ruby : :hiredis
REDIS_CACHE_PARAMS = {
driver: :hiredis,
driver: redis_driver,
url: ENV['CACHE_REDIS_URL'],
expires_in: 10.minutes,
namespace: "#{cache_namespace}:7.1",
@ -43,7 +45,7 @@ REDIS_CACHE_PARAMS = {
}.freeze
REDIS_SIDEKIQ_PARAMS = {
driver: :hiredis,
driver: redis_driver,
url: ENV['SIDEKIQ_REDIS_URL'],
namespace: sidekiq_namespace,
}.freeze