if ( $job ) {
$output = $job->toString() . "\n";
$t = - microtime( true );
+ wfProfileIn( __METHOD__ . '-' . get_class( $job ) );
$success = $job->run();
+ wfProfileOut( __METHOD__ . '-' . get_class( $job ) );
$group->ack( $job ); // done
$t += microtime( true );
$t = round( $t * 1000 );
- if ( !$success ) {
+ if ( $success === false ) {
$output .= "Error: " . $job->getLastError() . ", Time: $t ms\n";
} else {
$output .= "Success, Time: $t ms\n";
* @return boolean success
*/
function run() {
- wfProfileIn( __METHOD__ );
-
$linkCache = LinkCache::singleton();
$linkCache->clear();
if ( is_null( $this->title ) ) {
$this->error = "refreshLinks: Invalid title";
- wfProfileOut( __METHOD__ );
return false;
}
if ( !$revision ) {
$this->error = 'refreshLinks: Article not found "' .
$this->title->getPrefixedDBkey() . '"';
- wfProfileOut( __METHOD__ );
return false; // XXX: what if it was just deleted?
}
self::runForTitleInternal( $this->title, $revision, __METHOD__ );
- wfProfileOut( __METHOD__ );
return true;
}
function run() {
global $wgUpdateRowsPerJob;
- wfProfileIn( __METHOD__ );
-
$linkCache = LinkCache::singleton();
$linkCache->clear();
if ( is_null( $this->title ) ) {
$this->error = "refreshLinks2: Invalid title";
- wfProfileOut( __METHOD__ );
return false;
}
JobQueueGroup::singleton()->push( $jobs );
}
- wfProfileOut( __METHOD__ );
return true;
}
// Run the job...
$t = microtime( true );
+ wfProfileIn( __METHOD__ . '-' . get_class( $job ) );
try {
$status = $job->run();
$error = $job->getLastError();
$status = false;
$error = get_class( $e ) . ': ' . $e->getMessage();
}
+ wfProfileOut( __METHOD__ . '-' . get_class( $job ) );
$timeMs = intval( ( microtime( true ) - $t ) * 1000 );
// Mark the job as done on success or when the job cannot be retried