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:
@@ -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
|
||||
|
Reference in New Issue
Block a user