From: Aaron Schulz Date: Fri, 13 Mar 2015 01:06:28 +0000 (-0700) Subject: Made getNewtalk use slaves instead of cache/master X-Git-Tag: 1.31.0-rc.0~12103 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=58c8e2b969457b6945533d966b265a3804f11f36;p=lhc%2Fweb%2Fwiklou.git Made getNewtalk use slaves instead of cache/master * This was causing floods of master connections on page views Bug: T92357 Change-Id: I02fd1505f589112b8f6217047e6713845142a1c3 --- diff --git a/includes/User.php b/includes/User.php index a4f6b77bab..c811dd5d29 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2011,17 +2011,7 @@ class User implements IDBAccessObject { // Anon newtalk disabled by configuration. $this->mNewtalk = false; } else { - global $wgMemc; - $key = wfMemcKey( 'newtalk', 'ip', $this->getName() ); - $newtalk = $wgMemc->get( $key ); - if ( strval( $newtalk ) !== '' ) { - $this->mNewtalk = (bool)$newtalk; - } else { - // Since we are caching this, make sure it is up to date by getting it - // from the master - $this->mNewtalk = $this->checkNewtalk( 'user_ip', $this->getName(), true ); - $wgMemc->set( $key, (int)$this->mNewtalk, 1800 ); - } + $this->mNewtalk = $this->checkNewtalk( 'user_ip', $this->getName() ); } } else { $this->mNewtalk = $this->checkNewtalk( 'user_id', $this->mId );