[MediaWiki-commits] [Gerrit] Dont log to CirrusSearchRequestSet when disabled - change (mediawiki...CirrusSearch)

2016-03-08 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Dont log to CirrusSearchRequestSet when disabled
..


Dont log to CirrusSearchRequestSet when disabled

runSearch.php sets a global variable to tell cirrussearch not
to log it's requests. This works for the CirrusSearchRequests
channel but the new CirrusSearchRequestSet channel was ignoring
it. Fix that.

Change-Id: I93e9f44a3400b25d99529fefdcd8a5b6ab870e32
---
M includes/ElasticsearchIntermediary.php
1 file changed, 9 insertions(+), 5 deletions(-)

Approvals:
  Smalyshev: Looks good to me, approved
  Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/ElasticsearchIntermediary.php 
b/includes/ElasticsearchIntermediary.php
index 3610955..e12e03c 100644
--- a/includes/ElasticsearchIntermediary.php
+++ b/includes/ElasticsearchIntermediary.php
@@ -536,6 +536,8 @@
 * @return array
 */
private function buildLogContext( $took, Client $client = null ) {
+   global $wgCirrusSearchLogElasticRequests;
+
if ( $client ) {
$query = $client->getLastRequest();
$result = $client->getLastResponse();
@@ -582,12 +584,14 @@
}
}
 
-   if ( count( self::$logContexts ) === 0 ) {
-   DeferredUpdates::addCallableUpdate( function () {
-   ElasticsearchIntermediary::reportLogContexts();
-   } );
+   if ( $wgCirrusSearchLogElasticRequests ) {
+   if ( count( self::$logContexts ) === 0 ) {
+   DeferredUpdates::addCallableUpdate( function () 
{
+   
ElasticsearchIntermediary::reportLogContexts();
+   } );
+   }
+   self::$logContexts[] = $params;
}
-   self::$logContexts[] = $params;
 
return $params;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I93e9f44a3400b25d99529fefdcd8a5b6ab870e32
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 
Gerrit-Reviewer: Cindy-the-browser-test-bot 
Gerrit-Reviewer: DCausse 
Gerrit-Reviewer: Manybubbles 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Dont log to CirrusSearchRequestSet when disabled - change (mediawiki...CirrusSearch)

2016-03-04 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Dont log to CirrusSearchRequestSet when disabled
..

Dont log to CirrusSearchRequestSet when disabled

runSearch.php sets a global variable to tell cirrussearch not
to log it's requests. This works for the CirrusSearchRequests
channel but the new CirrusSearchRequestSet channel was ignoring
it. Fix that.

Change-Id: I93e9f44a3400b25d99529fefdcd8a5b6ab870e32
---
M includes/ElasticsearchIntermediary.php
1 file changed, 9 insertions(+), 5 deletions(-)


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

diff --git a/includes/ElasticsearchIntermediary.php 
b/includes/ElasticsearchIntermediary.php
index 3610955..e12e03c 100644
--- a/includes/ElasticsearchIntermediary.php
+++ b/includes/ElasticsearchIntermediary.php
@@ -536,6 +536,8 @@
 * @return array
 */
private function buildLogContext( $took, Client $client = null ) {
+   global $wgCirrusSearchLogElasticRequests;
+
if ( $client ) {
$query = $client->getLastRequest();
$result = $client->getLastResponse();
@@ -582,12 +584,14 @@
}
}
 
-   if ( count( self::$logContexts ) === 0 ) {
-   DeferredUpdates::addCallableUpdate( function () {
-   ElasticsearchIntermediary::reportLogContexts();
-   } );
+   if ( $wgCirrusSearchLogElasticRequests ) {
+   if ( count( self::$logContexts ) === 0 ) {
+   DeferredUpdates::addCallableUpdate( function () 
{
+   
ElasticsearchIntermediary::reportLogContexts();
+   } );
+   }
+   self::$logContexts[] = $params;
}
-   self::$logContexts[] = $params;
 
return $params;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I93e9f44a3400b25d99529fefdcd8a5b6ab870e32
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits