jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/332334 )

Change subject: maintenance/importImages: Don't sleep after the last upload
......................................................................


maintenance/importImages: Don't sleep after the last upload

Currently, the importImages maintenance script offers an option
to sleep an arbitrary amount of seconds after each upload.

The current logic implementation had a side effect to also sleep
after the last image upload. This is not a desired behavior, as
the tasks are done and a clean exit with a report are welcome.

Instead, sleep will now occur before the second upload and the
ones to follow.

Change-Id: Ia675f210582c3075e9b59b002a00cb1fc4b44cac
---
M maintenance/importImages.php
1 file changed, 5 insertions(+), 4 deletions(-)

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



diff --git a/maintenance/importImages.php b/maintenance/importImages.php
index 7f2a9e1..4a3d2d6 100644
--- a/maintenance/importImages.php
+++ b/maintenance/importImages.php
@@ -187,6 +187,11 @@
                if ( $count > 0 ) {
 
                        foreach ( $files as $file ) {
+
+                               if ( $sleep && ( $processed > 0 ) ) {
+                                       sleep( $sleep );
+                               }
+
                                $base = UtfNormal\Validator::cleanUp( 
wfBaseName( $file ) );
 
                                # Validate a title
@@ -374,10 +379,6 @@
 
                                if ( $limit && $processed >= $limit ) {
                                        break;
-                               }
-
-                               if ( $sleep ) {
-                                       sleep( $sleep );
                                }
                        }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia675f210582c3075e9b59b002a00cb1fc4b44cac
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Dereckson <dereck...@espace-win.org>
Gerrit-Reviewer: Dereckson <dereck...@espace-win.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Parent5446 <tylerro...@gmail.com>
Gerrit-Reviewer: TTO <at.li...@live.com.au>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to