jenkins-bot has submitted this change and it was merged.

Change subject: Made findMissingFiles use preloadFileStat() on old versions too 
to speed it up
......................................................................


Made findMissingFiles use preloadFileStat() on old versions too to speed it up

Change-Id: I03133c146f5a4f07f27b26dd033d6c93b72aea04
---
M maintenance/findMissingFiles.php
1 file changed, 11 insertions(+), 3 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/maintenance/findMissingFiles.php b/maintenance/findMissingFiles.php
index 8c71699..ac132fd 100644
--- a/maintenance/findMissingFiles.php
+++ b/maintenance/findMissingFiles.php
@@ -66,14 +66,22 @@
                                        array( 'oi_name' => array_keys( 
$pathsByName ) ),
                                        __METHOD__
                                );
+
+                               $checkPaths = array();
                                foreach ( $ores as $row ) {
                                        if ( !strlen( $row->oi_archive_name ) ) 
{
                                                continue; // broken row
                                        }
                                        $file = $repo->newFromArchiveName( 
$row->oi_name, $row->oi_archive_name );
-                                       $path = $file->getPath();
-                                       if ( $be->fileExists( array( 'src' => 
$path ) ) === false ) {
-                                               $this->output( "$path\n" );
+                                       $checkPaths[] = $file->getPath();
+                               }
+
+                               foreach ( array_chunk( $checkPaths, 
$this->mBatchSize ) as $paths ) {
+                                       $be->preloadFileStat( array( 'srcs' => 
$paths ) );
+                                       foreach ( $paths as $path ) {
+                                               if ( $be->fileExists( array( 
'src' => $path ) ) === false ) {
+                                                       $this->output( 
"$path\n" );
+                                               }
                                        }
                                }
                        }

-- 
To view, visit https://gerrit.wikimedia.org/r/156981
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I03133c146f5a4f07f27b26dd033d6c93b72aea04
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.24wmf18
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to