0
0
Fork 0

Fix single Redis connection being used across all threads (#18135)

* Fix single Redis connection being used across all Sidekiq threads

* Fix tests
This commit is contained in:
Eugen Rochko 2022-04-28 17:47:34 +02:00 committed by GitHub
parent 9bf04db23a
commit 3917353645
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 243 additions and 124 deletions

View file

@ -14,7 +14,7 @@ RSpec.describe AfterBlockService, type: :service do
let(:home_timeline_key) { FeedManager.instance.key(:home, account.id) }
before do
Redis.current.del(home_timeline_key)
redis.del(home_timeline_key)
end
it "clears account's statuses" do
@ -23,7 +23,7 @@ RSpec.describe AfterBlockService, type: :service do
FeedManager.instance.push_to_home(account, other_account_reblog)
expect { subject }.to change {
Redis.current.zrange(home_timeline_key, 0, -1)
redis.zrange(home_timeline_key, 0, -1)
}.from([status.id.to_s, other_account_status.id.to_s, other_account_reblog.id.to_s]).to([other_account_status.id.to_s])
end
end
@ -33,7 +33,7 @@ RSpec.describe AfterBlockService, type: :service do
let(:list_timeline_key) { FeedManager.instance.key(:list, list.id) }
before do
Redis.current.del(list_timeline_key)
redis.del(list_timeline_key)
end
it "clears account's statuses" do
@ -42,7 +42,7 @@ RSpec.describe AfterBlockService, type: :service do
FeedManager.instance.push_to_list(list, other_account_reblog)
expect { subject }.to change {
Redis.current.zrange(list_timeline_key, 0, -1)
redis.zrange(list_timeline_key, 0, -1)
}.from([status.id.to_s, other_account_status.id.to_s, other_account_reblog.id.to_s]).to([other_account_status.id.to_s])
end
end