about summary refs log tree commit diff
path: root/spec/workers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-04-28 17:47:34 +0200
committerGitHub <noreply@github.com>2022-04-28 17:47:34 +0200
commit3917353645b91dae04f7d9b81162fead6f73072a (patch)
tree202cbf93dfa378c26a291900ea65ec088ee5b5cc /spec/workers
parent9bf04db23acf10e05ffdf7def06c246081f8f065 (diff)
Fix single Redis connection being used across all threads (#18135)
* Fix single Redis connection being used across all Sidekiq threads

* Fix tests
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/scheduler/feed_cleanup_scheduler_spec.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/workers/scheduler/feed_cleanup_scheduler_spec.rb b/spec/workers/scheduler/feed_cleanup_scheduler_spec.rb
index 914eed829..82d794594 100644
--- a/spec/workers/scheduler/feed_cleanup_scheduler_spec.rb
+++ b/spec/workers/scheduler/feed_cleanup_scheduler_spec.rb
@@ -7,17 +7,17 @@ describe Scheduler::FeedCleanupScheduler do
   let!(:inactive_user) { Fabricate(:user, current_sign_in_at: 22.days.ago) }
 
   it 'clears feeds of inactives' do
-    Redis.current.zadd(feed_key_for(inactive_user), 1, 1)
-    Redis.current.zadd(feed_key_for(active_user), 1, 1)
-    Redis.current.zadd(feed_key_for(inactive_user, 'reblogs'), 2, 2)
-    Redis.current.sadd(feed_key_for(inactive_user, 'reblogs:2'), 3)
+    redis.zadd(feed_key_for(inactive_user), 1, 1)
+    redis.zadd(feed_key_for(active_user), 1, 1)
+    redis.zadd(feed_key_for(inactive_user, 'reblogs'), 2, 2)
+    redis.sadd(feed_key_for(inactive_user, 'reblogs:2'), 3)
 
     subject.perform
 
-    expect(Redis.current.zcard(feed_key_for(inactive_user))).to eq 0
-    expect(Redis.current.zcard(feed_key_for(active_user))).to eq 1
-    expect(Redis.current.exists?(feed_key_for(inactive_user, 'reblogs'))).to be false
-    expect(Redis.current.exists?(feed_key_for(inactive_user, 'reblogs:2'))).to be false
+    expect(redis.zcard(feed_key_for(inactive_user))).to eq 0
+    expect(redis.zcard(feed_key_for(active_user))).to eq 1
+    expect(redis.exists?(feed_key_for(inactive_user, 'reblogs'))).to be false
+    expect(redis.exists?(feed_key_for(inactive_user, 'reblogs:2'))).to be false
   end
 
   def feed_key_for(user, subtype = nil)