The migration in will de-duplicate kudos on works, and we need to reindex them to keep the kudos sorting option on work searches/filters accurate. One more After task.
The task should only consider works with kudos.
The task should use StatCounterIndexer. We want to update the existing indexed works, we don't have to reindex whole works. The task should not reindex bookmarked works (a different index that doesn't track kudos count).
The task should process in batches and sensibly print its progress.
How to test:
Admins can edit a work's stat_counter to have some absurd kudos count.
Reindex the work to put it at the top of any kudos descending list.
Run the task.
Check that the work is positioned correctly in kudos descending lists.
On beta, this task should be run after AO3-5869.
The work is reindexed and now appears where it should:
You searched for: Author/Artist: redsummernight kudos count: 3 sort by: best match descending
Pressed the reindex work button.
Work did not appear at the top of the search
Work now at top of search, start the rake task
bundle exec rake After:update_indexed_stat_counter_kudo_count
Batch 769 of 769 complete
ao3app@test-front11:~/app/current$ bundle exec rails runner ~/bin/queue_status.rb
Traditionally wrangling staff has said
If reindex_low is at 500 or above, please don't wrangle large tags.
If it's above 1000, please stop wrangling for a bit and wait for it to go back down.
Current Time : 2020-03-15 09:18:57 +0000
Total pending jobs: 0
Total workers: 21
Workers working: 0
All seems well
We ran this on beta on Mar 18-19.