- if ( $dbw === null ) {
- $dbw = wfGetDB( DB_MASTER );
- }
-
- // Purge old, expired memberships from the DB
- $hasExpiredRow = $dbw->selectField(
- 'user_groups',
- '1',
- [ 'ug_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ],
- __METHOD__
- );
- if ( $hasExpiredRow ) {
- JobQueueGroup::singleton()->lazyPush( new UserGroupExpiryJob() );
- }
-
- // Check that the values make sense