dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f11a8b9
)
Optimize JobQueue utilization in UserGroupMembership::insert()
author
Aaron Schulz
<aschulz@wikimedia.org>
Fri, 5 Jul 2019 23:27:43 +0000
(16:27 -0700)
committer
Aaron Schulz
<aschulz@wikimedia.org>
Fri, 5 Jul 2019 23:27:43 +0000
(16:27 -0700)
Change-Id: I20d6d753221616817150f34307a8ffaf1bb74ae8
includes/user/UserGroupMembership.php
patch
|
blob
|
history
diff --git
a/includes/user/UserGroupMembership.php
b/includes/user/UserGroupMembership.php
index
e06df9f
..
eb55567
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
- 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 ) {