jenkins-bot has submitted this change and it was merged.

Change subject: Don't try to use the pool counter without a user
......................................................................


Don't try to use the pool counter without a user

We never want to even try because not having a users means we're running in a
batch context.

For T93040

Change-Id: I616b8ca926f8d40bf4079af28f643b3d43ade6ee
---
M includes/Util.php
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Util.php b/includes/Util.php
index c9c9c40..6c6fed4 100644
--- a/includes/Util.php
+++ b/includes/Util.php
@@ -103,6 +103,11 @@
                // By default the pool counter allows you to lock the same key 
with
                // multiple types.  That might be useful but it isn't how 
Cirrus thinks.
                // Instead, all keys are scoped to their type.
+
+               if ( !$user ) {
+                       // We don't want to even use the pool counter if there 
isn't a user.
+                       return $workCallback();
+               }
                $perUserKey = md5( $user->getName() );
                $perUserKey = "nowait:CirrusSearch:_per_user:$perUserKey";
                $globalKey = "$type:$wgCirrusSearchPoolCounterKey";

-- 
To view, visit https://gerrit.wikimedia.org/r/197532
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I616b8ca926f8d40bf4079af28f643b3d43ade6ee
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Manybubbles <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Jdouglas <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to