Manybubbles has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/197553

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
(cherry picked from commit 41119e821d29540212991923555b0657394159cb)
---
M includes/Util.php
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/53/197553/1

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/197553
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I616b8ca926f8d40bf4079af28f643b3d43ade6ee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: wmf/1.25wmf21
Gerrit-Owner: Manybubbles <[email protected]>

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

Reply via email to