From 3917353645b91dae04f7d9b81162fead6f73072a Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 28 Apr 2022 17:47:34 +0200 Subject: Fix single Redis connection being used across all threads (#18135) * Fix single Redis connection being used across all Sidekiq threads * Fix tests --- spec/controllers/concerns/user_tracking_concern_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'spec/controllers') diff --git a/spec/controllers/concerns/user_tracking_concern_spec.rb b/spec/controllers/concerns/user_tracking_concern_spec.rb index 1e5620221..b2548d5c0 100644 --- a/spec/controllers/concerns/user_tracking_concern_spec.rb +++ b/spec/controllers/concerns/user_tracking_concern_spec.rb @@ -65,22 +65,22 @@ describe ApplicationController, type: :controller do get :show expect_updated_sign_in_at(user) - expect(Redis.current.get("account:#{user.account_id}:regeneration")).to eq 'true' + expect(redis.get("account:#{user.account_id}:regeneration")).to eq 'true' expect(RegenerationWorker).to have_received(:perform_async) end it 'sets the regeneration marker to expire' do allow(RegenerationWorker).to receive(:perform_async) get :show - expect(Redis.current.ttl("account:#{user.account_id}:regeneration")).to be >= 0 + expect(redis.ttl("account:#{user.account_id}:regeneration")).to be >= 0 end it 'regenerates feed when sign in is older than two weeks' do get :show expect_updated_sign_in_at(user) - expect(Redis.current.zcard(FeedManager.instance.key(:home, user.account_id))).to eq 3 - expect(Redis.current.get("account:#{user.account_id}:regeneration")).to be_nil + expect(redis.zcard(FeedManager.instance.key(:home, user.account_id))).to eq 3 + expect(redis.get("account:#{user.account_id}:regeneration")).to be_nil end end -- cgit