* user_touched field when we update things.
* @return string Timestamp in TS_MW format
*/
- private static function newTouchedTimestamp() {
+ private function newTouchedTimestamp() {
global $wgClockSkewFudge;
- return wfTimestamp( TS_MW, time() + $wgClockSkewFudge );
+
+ $time = wfTimestamp( TS_MW, time() + $wgClockSkewFudge );
+ if ( $this->mTouched && $time <= $this->mTouched ) {
+ $time = wfTimestamp( TS_MW, wfTimestamp( TS_UNIX, $this->mTouched ) + 1 );
+ }
+
+ return $time;
}
/**
}
$this->load();
if ( $this->mId ) {
- $this->mTouched = self::newTouchedTimestamp();
+ $this->mTouched = $this->newTouchedTimestamp();
$dbw = wfGetDB( DB_MASTER );
$userid = $this->mId;
if ( $this->mId ) {
$key = wfMemcKey( 'user-quicktouched', 'id', $this->mId );
- $timestamp = self::newTouchedTimestamp();
+ $timestamp = $this->newTouchedTimestamp();
$wgMemc->set( $key, $timestamp );
$this->mQuickTouched = $timestamp;
}
wfWarn( "Attempting to save slave-loaded User object data." );
}
- $this->mTouched = self::newTouchedTimestamp();
+ $this->mTouched = $this->newTouchedTimestamp();
if ( !$wgAuth->allowSetLocalPassword() ) {
$this->mPassword = self::getPasswordFactory()->newFromCiphertext( null );
}
'user_token' => strval( $user->mToken ),
'user_registration' => $dbw->timestamp( $user->mRegistration ),
'user_editcount' => 0,
- 'user_touched' => $dbw->timestamp( self::newTouchedTimestamp() ),
+ 'user_touched' => $dbw->timestamp( $user->newTouchedTimestamp() ),
);
foreach ( $params as $name => $value ) {
$fields["user_$name"] = $value;
$this->setToken(); // init token
}
- $this->mTouched = self::newTouchedTimestamp();
+ $this->mTouched = $this->newTouchedTimestamp();
$dbw = wfGetDB( DB_MASTER );
$inWrite = $dbw->writesOrCallbacksPending();