From 1b217645ccc14105629a812ad8e1f154384302e9 Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Wed, 30 Jun 2021 14:04:59 +0200 Subject: [PATCH] Maintenance: Use the 'hiredis' gem for increased performance. --- Gemfile | 1 + Gemfile.lock | 4 ++++ lib/sessions/store/redis.rb | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 2836fde83..6895c3df9 100644 --- a/Gemfile +++ b/Gemfile @@ -29,6 +29,7 @@ gem 'delayed_job_active_record' # core - websocket gem 'em-websocket' gem 'eventmachine' +gem 'hiredis', require: false gem 'redis', require: false # core - password security diff --git a/Gemfile.lock b/Gemfile.lock index 379b1cdf5..3b3de1ae6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -251,6 +251,7 @@ GEM guard-compat (~> 1.1) hashdiff (0.3.8) hashie (3.6.0) + hiredis (0.6.3) htmlentities (4.3.4) http (3.3.0) addressable (~> 2.3) @@ -272,6 +273,7 @@ GEM ice_cube (0.16.3) inflection (1.0.0) interception (0.5) + ipaddr (1.2.2) json (2.3.0) jwt (2.2.2) kgio (2.11.2) @@ -370,6 +372,7 @@ GEM omniauth (~> 1.5) omniauth-oauth2 (>= 1.4.0) openssl (2.1.2) + ipaddr parallel (1.20.1) parser (3.0.1.1) ast (~> 2.4.1) @@ -630,6 +633,7 @@ DEPENDENCIES guard guard-livereload guard-symlink + hiredis htmlentities icalendar icalendar-recurrence diff --git a/lib/sessions/store/redis.rb b/lib/sessions/store/redis.rb index c2c474080..410833e2d 100644 --- a/lib/sessions/store/redis.rb +++ b/lib/sessions/store/redis.rb @@ -9,7 +9,8 @@ class Sessions::Store::Redis def initialize # Only load redis if it is really used. require 'redis' - @redis = Redis.new + require 'hiredis' + @redis = Redis.new( driver: :hiredis ) end def create(client_id, data)