MediaWiki r9403 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r9402‎ | r9403 (on ViewVC)‎ | r9404 >
Date:17:05, 12 June 2005
Author:timstarling
Status:old
Tags:
Comment:
ported clock skew fudge from 1.4
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/User.php
===================================================================
--- trunk/phase3/includes/User.php	(revision 9402)
+++ trunk/phase3/includes/User.php	(revision 9403)
@@ -687,8 +687,9 @@
 	}
 
 	function invalidateCache() {
+		global $wgClockSkewFudge;
 		$this->loadFromDatabase();
-		$this->mTouched = wfTimestampNow();
+		$this->mTouched = wfTimestamp(TS_MW, time() + $wgClockSkewFudge );
 		# Don't forget to save the options after this or
 		# it won't take effect!
 	}
@@ -1197,7 +1198,6 @@
 		$wgMemc->delete( "$wgDBname:user:id:$this->mId" );
 	}
 
-	
 	/**
 	 * Checks if a user with the given name exists, returns the ID
 	 */
Index: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php	(revision 9402)
+++ trunk/phase3/includes/DefaultSettings.php	(revision 9403)
@@ -786,6 +786,13 @@
 
 $wgCookieExpiration = 2592000;
 
+/** Clock skew or the one-second resolution of time() can occasionally cause cache 
+ * problems when the user requests two pages within a short period of time. This
+ * variable adds a given number of seconds to vulnerable timestamps, thereby giving
+ * a grace period.
+ */
+$wgClockSkewFudge = 5;
+
 # Squid-related settings
 #
 

Status & tagging log

  • 01:56, 13 October 2010 ^demon (Talk | contribs) changed the status of r9403 [removed: new added: old]
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox