r59358 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59357‎ | r59358 | r59359 >
Date:18:20, 23 November 2009
Author:ialex
Status:ok
Tags:
Comment:
removed trailing whitespaces
Modified paths:
  • /trunk/phase3/maintenance/nextJobDB.php (modified) (history)
  • /trunk/phase3/maintenance/updateSpecialPages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/updateSpecialPages.php
@@ -65,18 +65,18 @@
6666
6767 foreach( $wgQueryPages as $page ) {
6868 @list( $class, $special, $limit ) = $page;
69 -
 69+
7070 # --list : just show the name of pages
7171 if( $this->hasOption('list') ) {
7272 $this->output( "$special\n" );
7373 continue;
7474 }
75 -
 75+
7676 if ( !$this->hasOption('override') && $wgDisableQueryPageUpdate && in_array( $special, $wgDisableQueryPageUpdate ) ) {
7777 $this->output( sprintf( "%-30s disabled\n", $special ) );
7878 continue;
7979 }
80 -
 80+
8181 $specialObj = SpecialPage::getPage( $special );
8282 if ( !$specialObj ) {
8383 $this->output( "No such special page: $special\n" );
@@ -87,7 +87,7 @@
8888 require_once( $file );
8989 }
9090 $queryPage = new $class;
91 -
 91+
9292 if( !$this->hasOption('only') || $this->getOption('only') == $queryPage->getName() ) {
9393 $this->output( sprintf( '%-30s ', $special ) );
9494 if ( $queryPage->isExpensive() ) {
@@ -99,7 +99,7 @@
100100 $this->output( "FAILED: database error\n" );
101101 } else {
102102 $this->output( "got $num rows in " );
103 -
 103+
104104 $elapsed = ($t2[0] - $t1[0]) + ($t2[1] - $t1[1]);
105105 $hours = intval( $elapsed / 3600 );
106106 $minutes = intval( $elapsed % 3600 / 60 );
Index: trunk/phase3/maintenance/nextJobDB.php
@@ -29,6 +29,7 @@
3030 $this->mDescription = "Pick a database that has pending jobs";
3131 $this->addOption( 'type', "The type of job to search for", false, true );
3232 }
 33+
3334 public function execute() {
3435 global $wgMemc;
3536 $type = $this->getOption( 'type', false );
@@ -36,18 +37,18 @@
3738 ? "jobqueue:dbs"
3839 : "jobqueue:dbs:$type";
3940 $pendingDBs = $wgMemc->get( $mckey );
40 -
 41+
4142 # If we didn't get it from the cache
4243 if( !$pendingDBs ) {
4344 $pendingDBs = $this->getPendingDbs( $type );
4445 $wgMemc->get( $mckey, $pendingDBs, 300 );
4546 }
46 - # If we've got a pending job in a db, display it.
 47+ # If we've got a pending job in a db, display it.
4748 if ( $pendingDBs ) {
4849 $this->output( $pendingDBs[mt_rand(0, count( $pendingDBs ) - 1)] );
4950 }
5051 }
51 -
 52+
5253 /**
5354 * Get all databases that have a pending job
5455 * @param $type String Job type
@@ -62,12 +63,11 @@
6364 $lb = wfGetLB( $db );
6465 $dbsByMaster[$lb->getServerName(0)][] = $db;
6566 }
66 -
 67+
6768 foreach ( $dbsByMaster as $master => $dbs ) {
6869 $dbConn = wfGetDB( DB_MASTER, array(), $dbs[0] );
69 - $stype = $dbConn->addQuotes($type);
70 -
71 -
 70+ $stype = $dbConn->addQuotes( $type );
 71+
7272 # Padding row for MySQL bug
7373 $sql = "(SELECT '-------------------------------------------' as db)";
7474 foreach ( $dbs as $wikiId ) {

Status & tagging log