r47306 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47305‎ | r47306 | r47307 >
Date:04:50, 16 February 2009
Author:tstarling
Status:ok
Tags:
Comment:
Better logging in runJobs.php. Committing for test on server.
Modified paths:
  • /trunk/phase3/maintenance/runJobs.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/runJobs.php
@@ -43,10 +43,15 @@
4444 break;
4545
4646 wfWaitForSlaves( 5 );
47 - print wfTimestamp( TS_DB ) . " " . $job->id . " " . $job->toString() . "\n";
 47+ $t = microtime( true );
4848 $offset=$job->id;
 49+ $status = $job->run();
 50+ $t = microtime( true ) - $t;
 51+ $timeMs = intval( $t * 1000 );
4952 if ( !$job->run() ) {
50 - print wfTimestamp( TS_DB ) . " Error: {$job->error}\n";
 53+ runJobsLog( $job->toString() . " t=$timeMs error={$job->error}" );
 54+ } else {
 55+ runJobsLog( $job->toString() . " t=$timeMs good" );
5156 }
5257 if ( $maxJobs && ++$n > $maxJobs ) {
5358 break 2;
@@ -54,3 +59,9 @@
5560 }
5661 }
5762
 63+
 64+function runJobsLog( $msg ) {
 65+ print wfTimestamp( TS_DB ) . " $msg\n";
 66+ wfDebugLog( 'runJobs', $msg );
 67+}
 68+

Status & tagging log