The GlobalBlocking::purgeExpired method need to be moved to a separate service where the method is not static to allow easier testing and to be able to mock this method when testing the code that calls it.
This is because the purge method describes itself as expensive and as such could cause tests which do not verify the behaviour of the purge method to be unnecessarily slower.
Acceptance criteria
- Move the GlobalBlocking::purgeExpired method to a new service
- Update the method to use SQL query builders and make the method more like DatabaseBlockStore::purgeExpiredBlocks for consistency.
- Fully test this new service.
QA Results - Local
AC | Status | Details |
---|---|---|
1 | ✅ | https://phabricator.wikimedia.org/T357443 here |