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

@ -12,7 +12,7 @@ RSpec.describe BatchedRemoveStatusService, type: :service do
let(:status2) { PostStatusService.new.call(alice, text: 'Another status') }
before do
allow(Redis.current).to receive_messages(publish: nil)
allow(redis).to receive_messages(publish: nil)
stub_request(:post, 'http://example.com/inbox').to_return(status: 200)
@ -40,11 +40,11 @@ RSpec.describe BatchedRemoveStatusService, type: :service do
end
it 'notifies streaming API of followers' do
expect(Redis.current).to have_received(:publish).with("timeline:#{jeff.id}", any_args).at_least(:once)
expect(redis).to have_received(:publish).with("timeline:#{jeff.id}", any_args).at_least(:once)
end
it 'notifies streaming API of public timeline' do
expect(Redis.current).to have_received(:publish).with('timeline:public', any_args).at_least(:once)
expect(redis).to have_received(:publish).with('timeline:public', any_args).at_least(:once)
end
it 'sends delete activity to followers' do