r6659 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r6658‎ | r6659 | r6660 >
Date:21:15, 12 December 2004
Author:vibber
Status:old
Tags:
Comment:
(bug 730) Hack at Jamesday's request to avoid trying to update old recentchanges entries for the oldid when they probably are not in the table.
This is the wrong fix, probably, but ought to do the job for now. Certainly the hardcoded length needs to be centralized.
Modified paths:
  • /branches/REL1_3A/phase3/includes/RecentChange.php (modified) (history)

Diff [purge]

Index: branches/REL1_3A/phase3/includes/RecentChange.php
@@ -109,10 +109,16 @@
110110 $now = $this->mAttribs['rc_timestamp'];
111111 $curId = $this->mAttribs['rc_cur_id'];
112112
113 - # Update rc_this_oldid for the entries which were current
114 - $sql = "UPDATE recentchanges SET rc_this_oldid={$oldid} " .
115 - "WHERE rc_namespace=$ns AND rc_title='$title' AND rc_timestamp='$lastTime'";
116 - wfQuery( $sql, DB_WRITE, $fname );
 113+ # HACK HACK HACK on Jamesday's insistence
 114+ # http://bugzilla.wikipedia.org/show_bug.cgi?id=730
 115+ $age = time() - wfTimestamp2Unix( $lastTime );
 116+ $maxage = 7 * 24 * 3600; # our one week cutoff
 117+ if( $age < $maxage ) {
 118+ # Update rc_this_oldid for the entries which were current
 119+ $sql = "UPDATE recentchanges SET rc_this_oldid={$oldid} " .
 120+ "WHERE rc_namespace=$ns AND rc_title='$title' AND rc_timestamp='$lastTime'";
 121+ wfQuery( $sql, DB_WRITE, $fname );
 122+ }
117123
118124 # Update rc_cur_time
119125 $sql = "UPDATE recentchanges SET rc_cur_time='{$now}' " .

Follow-up revisions

RevisionCommit summaryAuthorDate
r7169* (bug 730) configurable $wgRCMaxAge; don't try to update purged RC entriesvibber03:53, 19 January 2005
r7170* (bug 730) configurable $wgRCMaxAge; don't try to update purged RC entriesvibber03:54, 19 January 2005

Status & tagging log