We should adjust the order that queryservice updater batches are worked on ( https://github.com/wbstack/api/blob/cc8323a6e88c11919aa35dd55f3cff9bffa16176/app/Http/Controllers/Backend/QsController.php#L76 )
To ensure that we don't have a "last in first out" system where unlucky wikis end up at the back of a queue while a busy wiki is continually editing.
Refactoring of this class and adding some tests is clearly important.
The logic should could look as follows:
- generate new batches
- coalesce old and new batches together if possible
- if there are already batches that are not done return the oldest of these first
We should ensure that whatever implementation we chose doesn't favour one heavily edited wiki over a smaller more lightly edited wiki.