2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-06-14 11:34:41 +02:00
|
|
|
redis_shared_options = {
|
2024-01-24 09:44:24 +01:00
|
|
|
url: ENV['REDIS_CACHE_URL'], # will fallback to default redis url if empty, and won't fail if there is no redis server
|
2024-06-12 19:31:50 +02:00
|
|
|
ssl: ENV['REDIS_CACHE_SSL'] == 'enabled',
|
|
|
|
connect_timeout: 0.2
|
2024-01-24 09:44:24 +01:00
|
|
|
}
|
2024-06-14 11:34:41 +02:00
|
|
|
redis_shared_options[:ssl_params] = { verify_mode: OpenSSL::SSL::VERIFY_NONE } if ENV['REDIS_CACHE_SSL_VERIFY_NONE'] == 'enabled'
|
2024-01-24 09:44:24 +01:00
|
|
|
|
2024-06-14 11:34:41 +02:00
|
|
|
Kredis::Connections.connections[:shared] = Redis.new(redis_shared_options)
|