dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Title: Title::getSubpage should not lose the interwiki prefix"
[lhc/web/wiklou.git]
/
includes
/
user
/
UserGroupMembership.php
diff --git
a/includes/user/UserGroupMembership.php
b/includes/user/UserGroupMembership.php
index
e06df9f
..
dff19ff
100644
(file)
--- a/
includes/user/UserGroupMembership.php
+++ b/
includes/user/UserGroupMembership.php
@@
-159,7
+159,15
@@
class UserGroupMembership {
}
// Purge old, expired memberships from the DB
}
// Purge old, expired memberships from the DB
- JobQueueGroup::singleton()->push( new UserGroupExpiryJob() );
+ $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
if ( $this->group === null ) {
// Check that the values make sense
if ( $this->group === null ) {
@@
-250,7
+258,7
@@
class UserGroupMembership {
$ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
$dbw = $services->getDBLoadBalancer()->getConnection( DB_MASTER );
$ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
$dbw = $services->getDBLoadBalancer()->getConnection( DB_MASTER );
- $lockKey =
$dbw->getDomainID() . ':usergroups-prune'; // specific to this
wiki
+ $lockKey =
"{$dbw->getDomainID()}:UserGroupMembership:purge"; // per-
wiki
$scopedLock = $dbw->getScopedLockAndFlush( $lockKey, __METHOD__, 0 );
if ( !$scopedLock ) {
return false; // already running
$scopedLock = $dbw->getScopedLockAndFlush( $lockKey, __METHOD__, 0 );
if ( !$scopedLock ) {
return false; // already running