From b292c89f24eb8668d0df7a09b31a7a32d6a8465f Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 25 Nov 2003 06:57:24 +0000 Subject: [PATCH] Fix incremental link update with persistent linkcache --- includes/Article.php | 1 + includes/LinkCache.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 08594baeeb..282886a752 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -492,6 +492,7 @@ class Article { "WHERE rc_cur_id=" . $this->getID(); wfQuery( $sql, DB_WRITE, $fname ); + global $wgEnablePersistentLC; if ( $wgEnablePersistentLC ) { // Purge link cache for this page diff --git a/includes/LinkCache.php b/includes/LinkCache.php index 80e7c5cae9..108f88783c 100644 --- a/includes/LinkCache.php +++ b/includes/LinkCache.php @@ -154,10 +154,11 @@ class LinkCache { if( $row != FALSE){ $cacheobj = gzuncompress( $row->lcc_cacheobj ); $cc = unserialize( $cacheobj ); - $this->mGoodLinks = $cc->mGoodLinks; - $this->mBadLinks = $cc->mBadLinks; + $this->mOldGoodLinks = $this->mGoodLinks = $cc->mGoodLinks; + $this->mOldBadLinks = $this->mBadLinks = $cc->mBadLinks; $this->mPreFilled = true; wfProfileOut( $fname ); + wfDebug( "LinkCache::preFill - got from linkscc\n" ); return; } } @@ -194,6 +195,7 @@ class LinkCache { $serCachegz = wfStrencode( gzcompress( serialize( $this ), 3) ); wfQuery("REPLACE INTO linkscc VALUES({$id}, '{$dbkeyfrom}', '{$serCachegz}')", DB_WRITE); + wfDebug( "LinkCache::preFill - saved to linkscc\n" ); } wfProfileOut( $fname ); @@ -206,6 +208,8 @@ class LinkCache { function getBadAdditions() { + #wfDebug( "mOldBadLinks: " . implode( ', ', array_keys( $this->mOldBadLinks ) ) . "\n" ); + #wfDebug( "mBadLinks: " . implode( ', ', array_keys( $this->mBadLinks ) ) . "\n" ); return array_values( array_diff( array_keys( $this->mBadLinks ), array_keys( $this->mOldBadLinks ) ) ); } -- 2.20.1