From: Tim Starling Date: Mon, 16 Feb 2009 04:50:26 +0000 (+0000) Subject: Better logging in runJobs.php. Committing for test on server. X-Git-Tag: 1.31.0-rc.0~42883 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=8165bea5215bbf858c0535fe88495629ac442691;p=lhc%2Fweb%2Fwiklou.git Better logging in runJobs.php. Committing for test on server. --- diff --git a/maintenance/runJobs.php b/maintenance/runJobs.php index f75b733e9c..e2a589544b 100644 --- a/maintenance/runJobs.php +++ b/maintenance/runJobs.php @@ -43,10 +43,15 @@ while ( $dbw->selectField( 'job', 'job_id', $conds, 'runJobs.php' ) ) { break; wfWaitForSlaves( 5 ); - print wfTimestamp( TS_DB ) . " " . $job->id . " " . $job->toString() . "\n"; + $t = microtime( true ); $offset=$job->id; + $status = $job->run(); + $t = microtime( true ) - $t; + $timeMs = intval( $t * 1000 ); if ( !$job->run() ) { - print wfTimestamp( TS_DB ) . " Error: {$job->error}\n"; + runJobsLog( $job->toString() . " t=$timeMs error={$job->error}" ); + } else { + runJobsLog( $job->toString() . " t=$timeMs good" ); } if ( $maxJobs && ++$n > $maxJobs ) { break 2; @@ -54,3 +59,9 @@ while ( $dbw->selectField( 'job', 'job_id', $conds, 'runJobs.php' ) ) { } } + +function runJobsLog( $msg ) { + print wfTimestamp( TS_DB ) . " $msg\n"; + wfDebugLog( 'runJobs', $msg ); +} +