[MediaWiki-commits] [Gerrit] mediawiki...SpamRegex[master]: Cache fix to ensure that the list of blocked entries shows u...

2016-12-01 Thread Jack Phoenix (Code Review)
Jack Phoenix has submitted this change and it was merged.

Change subject: Cache fix to ensure that the list of blocked entries shows up 
correctly
..


Cache fix to ensure that the list of blocked entries shows up correctly

Previously on cache miss the whole "query DB for accurate data" loop would
be skipped altogether and $results (which is set to 0 just above the
aforementioned loop) would be returned, hence the UI wrongly claiming that
there are no blocked entries when in fact the spam_regex table had some
entries.

HT SamanthaNguyen

Change-Id: I2d2db935df59f1b0c029b23c31f922a0528e1bec
---
M backend/spamRegexList.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jack Phoenix: Verified; Looks good to me, approved



diff --git a/backend/spamRegexList.php b/backend/spamRegexList.php
index 4e782ce..9668145 100644
--- a/backend/spamRegexList.php
+++ b/backend/spamRegexList.php
@@ -199,7 +199,7 @@
$cached = $wgMemc->get( $key );
$results = 0;
 
-   if ( is_null( $cached ) || $cached === false ) {
+   if ( !$cached || is_null( $cached ) || $cached === false ) {
$dbr = wfGetDB( DB_SLAVE );
$results = $dbr->selectField( 'spam_regex', 'COUNT(*)', 
'', __METHOD__ );
$wgMemc->set( $key, $results, 0 );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2d2db935df59f1b0c029b23c31f922a0528e1bec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SpamRegex
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 
Gerrit-Reviewer: Jack Phoenix 

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


[MediaWiki-commits] [Gerrit] mediawiki...SpamRegex[master]: Cache fix to ensure that the list of blocked entries shows u...

2016-12-01 Thread Jack Phoenix (Code Review)
Jack Phoenix has uploaded a new change for review.

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

Change subject: Cache fix to ensure that the list of blocked entries shows up 
correctly
..

Cache fix to ensure that the list of blocked entries shows up correctly

Previously on cache miss the whole "query DB for accurate data" loop would
be skipped altogether and $results (which is set to 0 just above the
aforementioned loop) would be returned, hence the UI wrongly claiming that
there are no blocked entries when in fact the spam_regex table had some
entries.

HT SamanthaNguyen

Change-Id: I2d2db935df59f1b0c029b23c31f922a0528e1bec
---
M backend/spamRegexList.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SpamRegex 
refs/changes/50/324850/1

diff --git a/backend/spamRegexList.php b/backend/spamRegexList.php
index 4e782ce..9668145 100644
--- a/backend/spamRegexList.php
+++ b/backend/spamRegexList.php
@@ -199,7 +199,7 @@
$cached = $wgMemc->get( $key );
$results = 0;
 
-   if ( is_null( $cached ) || $cached === false ) {
+   if ( !$cached || is_null( $cached ) || $cached === false ) {
$dbr = wfGetDB( DB_SLAVE );
$results = $dbr->selectField( 'spam_regex', 'COUNT(*)', 
'', __METHOD__ );
$wgMemc->set( $key, $results, 0 );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d2db935df59f1b0c029b23c31f922a0528e1bec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SpamRegex
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 

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