*/
public function invalidateCache() {
global $wgMemc;
+
if ( wfReadOnly() ) {
return false;
}
+
$dbw = wfGetDB( DB_MASTER );
- $success = $dbw->update(
- 'page',
- array( 'page_touched' => $dbw->timestamp() ),
- $this->pageCond(),
- __METHOD__
- );
+ $conds = $this->pageCond();
+ $dbw->onTransactionIdle( function() use ( $dbw, $conds ) {
+ $dbw->update(
+ 'page',
+ array( 'page_touched' => $dbw->timestamp() ),
+ $conds,
+ __METHOD__
+ );
+ } );
HTMLFileCache::clearFileCache( $this );
// Clear page info.
$revision = WikiPage::factory( $this )->getRevision();
- if( $revision !== null ) {
+ if ( $revision !== null ) {
$memcKey = wfMemcKey( 'infoaction', $this->getPrefixedText(), $revision->getId() );
- $success = $success && $wgMemc->delete( $memcKey );
+ $success = $wgMemc->delete( $memcKey );
+ } else {
+ $success = true;
}
return $success;