}
try {
- # Clear out any old cached data
- $dbw->delete( 'querycache', array( 'qc_type' => $this->getName() ), $fname );
# Do query
$res = $this->reallyDoQuery( $limit, false );
$num = false;
'qc_value' => $value );
}
+ $dbw->begin( __METHOD__ );
+ # Clear out any old cached data
+ $dbw->delete( 'querycache', array( 'qc_type' => $this->getName() ), $fname );
# Save results into the querycache table on the master
if ( count( $vals ) ) {
$dbw->insert( 'querycache', $vals, __METHOD__ );
$dbw->insert( 'querycache_info',
array( 'qci_type' => $this->getName(), 'qci_timestamp' => $dbw->timestamp() ),
$fname );
+ $dbw->commit( __METHOD__ );
}
} catch ( DBError $e ) {
if ( !$ignoreErrors ) {
sleep( 10 );
} while ( !wfGetLB()->pingAll() );
$this->output( "Reconnected\n\n" );
- } else {
- # Commit the results
- $dbw->commit( __METHOD__ );
}
# Wait for the slave to catch up
wfWaitForSlaves();