Made getNewtalk use slaves instead of cache/master
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 13 Mar 2015 01:06:28 +0000 (18:06 -0700)
committerOri.livneh <ori@wikimedia.org>
Fri, 13 Mar 2015 21:46:28 +0000 (21:46 +0000)
* This was causing floods of master connections on page views

Bug: T92357
Change-Id: I02fd1505f589112b8f6217047e6713845142a1c3

includes/User.php

index a4f6b77..c811dd5 100644 (file)
@@ -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 );