Aaron Schulz has uploaded a new change for review.
https://gerrit.wikimedia.org/r/156981
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/81/156981/1
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: newchange
Gerrit-Change-Id: I03133c146f5a4f07f27b26dd033d6c93b72aea04
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.24wmf18
Gerrit-Owner: Aaron Schulz <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits