From 15d1e1ec7e232c491663217100750fba997ccafe Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Fri, 12 Jan 2007 12:50:37 +0000 Subject: [PATCH] Wipe out memcached code from WatchedItem: does not make sense to cache (user,page), when hitrate is just 50% (and we lived without this cache forever) --- includes/WatchedItem.php | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index dac6e17439..f21b1b814b 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -31,31 +31,18 @@ class WatchedItem { return $wl; } - /** - * Returns the memcached key for this item - */ - function watchKey() { - return wfMemcKey( 'watchlist', 'user', $this->id, 'page', $this->ns, $this->ti ); - } - /** * Is mTitle being watched by mUser? */ function isWatched() { # Pages and their talk pages are considered equivalent for watching; # remember that talk namespaces are numbered as page namespace+1. - global $wgMemc; $fname = 'WatchedItem::isWatched'; - $key = $this->watchKey(); - $iswatched = $wgMemc->get( $key ); - if( $iswatched != '' ) return (int)$iswatched; - $dbr =& wfGetDB( DB_SLAVE ); $res = $dbr->select( 'watchlist', 1, array( 'wl_user' => $this->id, 'wl_namespace' => $this->ns, 'wl_title' => $this->ti ), $fname ); $iswatched = ($dbr->numRows( $res ) > 0) ? 1 : 0; - $wgMemc->set( $key, $iswatched ); return $iswatched; } @@ -87,14 +74,11 @@ class WatchedItem { 'wl_notificationtimestamp' => NULL ), $fname, 'IGNORE' ); - global $wgMemc; - $wgMemc->set( $this->watchkey(), 1 ); wfProfileOut( $fname ); return true; } function removeWatch() { - global $wgMemc; $fname = 'WatchedItem::removeWatch'; $success = false; @@ -125,9 +109,6 @@ class WatchedItem { if ( $dbw->affectedRows() ) { $success = true; } - if ( $success ) { - $wgMemc->set( $this->watchkey(), 0 ); - } return $success; } -- 2.20.1