From: Tim Starling Date: Sun, 12 Jun 2005 17:05:07 +0000 (+0000) Subject: ported clock skew fudge from 1.4 X-Git-Tag: 1.5.0beta1~194 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=1d12276bcb31d3146077f1eeb92443d76740ed82;p=lhc%2Fweb%2Fwiklou.git ported clock skew fudge from 1.4 --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 37d75c4708..017672b809 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -786,6 +786,13 @@ $wgShowUpdatedMarker = true; $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 # diff --git a/includes/User.php b/includes/User.php index 485e5f6bfe..da3f9373a2 100644 --- a/includes/User.php +++ b/includes/User.php @@ -687,8 +687,9 @@ class User { } 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 @@ class User { $wgMemc->delete( "$wgDBname:user:id:$this->mId" ); } - /** * Checks if a user with the given name exists, returns the ID */