diff options
author | Domas Mituzas <midom@users.mediawiki.org> | 2007-01-12 12:50:37 +0000 |
---|---|---|
committer | Domas Mituzas <midom@users.mediawiki.org> | 2007-01-12 12:50:37 +0000 |
commit | 15d1e1ec7e232c491663217100750fba997ccafe (patch) | |
tree | b9a80658b1e1a43e1c25f4e9655851898949ba1a /includes/WatchedItem.php | |
parent | b91b0492086bf918b285cf7bef07f18bb2941fc9 (diff) | |
download | mediawikicore-15d1e1ec7e232c491663217100750fba997ccafe.tar.gz mediawikicore-15d1e1ec7e232c491663217100750fba997ccafe.zip |
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)
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/19161
Diffstat (limited to 'includes/WatchedItem.php')
-rw-r--r-- | includes/WatchedItem.php | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index dac6e1743908..f21b1b814bf9 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -32,30 +32,17 @@ class WatchedItem { } /** - * 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; } |