Remove trouble-some hiredis

The hiredis client was praised as being faster parsing bulk responses
but it seems to have multiple issues now:

- The redis release 5.0 moved hiredis support to another gem.
- I tried the hiredis-client gem and it raised errors.
- There are claims of worse performance of hiredis [1].
- Maintenance responsiveness has been questioned [2].

Using the default redis driver seems to work fine though.

[1]: https://discuss.rubyonrails.org/t/hiredis-does-not-support-ssl-action-cable/75945
[2]: https://github.com/redis/hiredis/issues/655
This commit is contained in:
Maikel Linke
2023-10-30 15:29:34 +11:00
parent 9d710652d4
commit 687176cf49
7 changed files with 5 additions and 10 deletions

View File

@@ -98,9 +98,8 @@ gem 'rack-rewrite'
gem 'rack-timeout'
gem 'roadie-rails'
gem 'hiredis'
gem 'puma'
gem 'redis', '>= 4.0', require: ['redis', 'redis/connection/hiredis']
gem 'redis'
gem 'sidekiq'
gem 'sidekiq-scheduler'

View File

@@ -331,7 +331,6 @@ GEM
hashery (2.1.2)
hashie (5.0.0)
highline (2.0.3)
hiredis (0.6.3)
htmlentities (4.3.4)
httpclient (2.8.3)
i18n (1.14.1)
@@ -853,7 +852,6 @@ DEPENDENCIES
good_migrations
haml
highline (= 2.0.3)
hiredis
i18n
i18n-js (~> 3.9.0)
image_processing
@@ -897,7 +895,7 @@ DEPENDENCIES
rails_safe_tasks (~> 1.0)
ransack (~> 4.1.0)
redcarpet
redis (>= 4.0)
redis
responders
rexml
roadie-rails

View File

@@ -193,7 +193,9 @@ module Spree
def clear_preference_cache
@payment_method.calculator.preferences.each_key do |key|
Rails.cache.delete(@payment_method.calculator.preference_cache_key(key))
# Only persisted models have cache keys.
cache_key = @payment_method.calculator.preference_cache_key(key)
Rails.cache.delete(cache_key) if cache_key
end
end

View File

@@ -16,7 +16,6 @@ Openfoodnetwork::Application.configure do
# :file_store is used by default when no cache store is specifically configured.
if !!ENV["PROFILE"] || !!ENV["DEV_CACHING"]
config.cache_store = :redis_cache_store, {
driver: :hiredis,
url: ENV.fetch("OFN_REDIS_URL", "redis://localhost:6379/1"),
expires_in: 90.minutes
}

View File

@@ -43,7 +43,6 @@ Openfoodnetwork::Application.configure do
# Use a different cache store in production
config.cache_store = :redis_cache_store, {
driver: :hiredis,
url: ENV.fetch("OFN_REDIS_URL", "redis://localhost:6380/0"),
reconnect_attempts: 1
}

View File

@@ -43,7 +43,6 @@ Openfoodnetwork::Application.configure do
# Use a different cache store in production
config.cache_store = :redis_cache_store, {
driver: :hiredis,
url: ENV.fetch("OFN_REDIS_URL", "redis://localhost:6380/0"),
reconnect_attempts: 1
}

View File

@@ -15,7 +15,6 @@ Openfoodnetwork::Application.configure do
# Separate cache stores when running in parallel
config.cache_store = :redis_cache_store, {
driver: :hiredis,
# Unique database number to avoid conflict with others
url: ENV.fetch("OFN_REDIS_TEST_URL", "redis://localhost:6379/3"),
reconnect_attempts: 1