0
0
Fork 0

Fix unnecessary queries when batch-removing statuses, 100x faster (#15387)

This commit is contained in:
Eugen Rochko 2020-12-22 17:13:55 +01:00 committed by GitHub
parent 67ebd61f11
commit 9915d11c0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 168 additions and 100 deletions

View file

@ -26,6 +26,11 @@ RSpec.describe BatchedRemoveStatusService, type: :service do
subject.call([status1, status2])
end
it 'removes statuses' do
expect { Status.find(status1.id) }.to raise_error ActiveRecord::RecordNotFound
expect { Status.find(status2.id) }.to raise_error ActiveRecord::RecordNotFound
end
it 'removes statuses from author\'s home feed' do
expect(HomeFeed.new(alice).get(10)).to_not include([status1.id, status2.id])
end