Add in \n from/to r95055 to LoadBalancer.php
authorSam Reed <reedy@users.mediawiki.org>
Sun, 21 Aug 2011 15:24:44 +0000 (15:24 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 21 Aug 2011 15:24:44 +0000 (15:24 +0000)
Differentiate error messages from r95050 per Hashar

includes/db/LoadBalancer.php
includes/media/Generic.php
maintenance/deleteBatch.php

index 671415b..171ca2e 100644 (file)
@@ -241,7 +241,7 @@ class LoadBalancer {
                                        $i = $this->getRandomNonLagged( $currentLoads, $wiki );
                                        if ( $i === false && count( $currentLoads ) != 0 )  {
                                                # All slaves lagged. Switch to read-only mode
-                                               wfDebugLog( 'replication', 'All slaves lagged. Switch to read-only mode' );
+                                               wfDebugLog( 'replication', "All slaves lagged. Switch to read-only mode\n" );
                                                $wgReadOnly = wfMessage( 'readonly_lag' )->useDatabase( false )->plain();
                                                $i = $this->pickRandom( $currentLoads );
                                                $laggedSlaveMode = true;
index ffc1a23..e22aad8 100644 (file)
@@ -495,9 +495,16 @@ abstract class MediaHandler {
                        $thumbstat = stat( $dstPath );
                        if( $thumbstat['size'] == 0 || $retval != 0 ) {
                                $result = unlink( $dstPath );
-                               wfDebugLog( 'thumbnail',
-                                       sprintf( 'Removing bad %d-byte thumbnail "%s". unlink() result: %d',
-                                               $thumbstat['size'], $dstPath, $result ) );
+
+                               if ( $result ) {
+                                       wfDebugLog( 'thumbnail',
+                                               sprintf( 'Removing bad %d-byte thumbnail "%s". unlink() succeeded',
+                                                       $thumbstat['size'], $dstPath ) );
+                               } else {
+                                       wfDebugLog( 'thumbnail',
+                                               sprintf( 'Removing bad %d-byte thumbnail "%s". unlink() failed',
+                                                       $thumbstat['size'], $dstPath ) );
+                               }
                                return true;
                        }
                }
index f5f850a..fdc4cfb 100644 (file)
@@ -81,7 +81,6 @@ class DeleteBatch extends Maintenance {
                                continue;
                        }
 
-
                        $this->output( $page->getPrefixedText() );
                        $dbw->begin();
                        if ( $page->getNamespace() == NS_FILE ) {