A platform for community discussion. Free, open, simple.
Revert "FIX: update Redis gem to version 4.1.3 (#8197)"
Sam Saffronae2a56999ed6
diff --git a/Gemfile b/Gemfileindex 8f032801eba..d523170a4ed 100644--- a/Gemfile+++ b/Gemfile@@ -36,7 +36,14 @@ gem 'mail', require: falsegem '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'diff --git a/Gemfile.lock b/Gemfile.lockindex bd215e663e0..d54d718a123 100644--- a/Gemfile.lock+++ b/Gemfile.lock@@ -309,7 +309,7 @@ GEMmsgpack (>= 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 @@ DEPENDENCIESrb-inotify (~> 0.9)rbtracerchardet- redis (= 4.1.3)+ redis (= 4.0.1)redis-namespacerinkurotpdiff --git a/config/application.rb b/config/application.rbindex a8f2fcc98fa..dd56bf859fe 100644--- a/config/application.rb+++ b/config/application.rb@@ -241,6 +241,7 @@ module Discourserequire 'discourse_redis'require 'logster/redis_store'+ require 'freedom_patches/redis'# Use redis for our cacheconfig.cache_store = DiscourseRedis.new_redis_store$redis = DiscourseRedis.newdiff --git a/lib/freedom_patches/redis.rb b/lib/freedom_patches/redis.rbnew file mode 100644index 00000000000..8945ece473e--- /dev/null+++ b/lib/freedom_patches/redis.rb@@ -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