Revert "FIX: update Redis gem to version 4.1.3 (#8197)"

This reverts commit ab74a50d85.

We really want to upgrade redis, but discovered some edge cases
around failover we need to test.

Holding off on the upgrade till a bit more testing happens
This commit is contained in:
Sam Saffron 2019-10-17 11:41:46 +11:00
parent ab74a50d85
commit ae2a56999e
4 changed files with 27 additions and 3 deletions

View File

@ -36,7 +36,14 @@ gem 'mail', require: false
gem 'mini_mime'
gem 'mini_suffix'
gem 'redis', '4.1.3'
# holding off redis upgrade temporarily as it is having issues with our current
# freedom patch, we will follow this up.
#
# FrozenError: can't modify frozen Hash
# /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/redis-4.1.0/lib/redis/client.rb:93:in `delete'
# /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/redis-4.1.0/lib/redis/client.rb:93:in `initialize'
# /var/www/discourse/lib/freedom_patches/redis.rb:7:in `initialize'
gem 'redis', '4.0.1'
gem 'redis-namespace'
gem 'active_model_serializers', '~> 0.8.3'

View File

@ -309,7 +309,7 @@ GEM
msgpack (>= 0.4.3)
optimist (>= 3.0.0)
rchardet (1.8.0)
redis (4.1.3)
redis (4.0.1)
redis-namespace (1.6.0)
redis (>= 3.0.4)
request_store (1.4.1)
@ -516,7 +516,7 @@ DEPENDENCIES
rb-inotify (~> 0.9)
rbtrace
rchardet
redis (= 4.1.3)
redis (= 4.0.1)
redis-namespace
rinku
rotp

View File

@ -241,6 +241,7 @@ module Discourse
require 'discourse_redis'
require 'logster/redis_store'
require 'freedom_patches/redis'
# Use redis for our cache
config.cache_store = DiscourseRedis.new_redis_store
$redis = DiscourseRedis.new

View File

@ -0,0 +1,16 @@
# frozen_string_literal: true
# https://github.com/redis/redis-rb/pull/591
class Redis
class Client
alias_method :old_initialize, :initialize
def initialize(options = {})
old_initialize(options)
if options.include?(:connector) && options[:connector].is_a?(Class)
@connector = options[:connector].new(@options)
end
end
end
end