Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/183161

Change subject: sendConfirmAndMigrateEmail: Add --sleep option
......................................................................

sendConfirmAndMigrateEmail: Add --sleep option

Change-Id: I6005f494faec3668f3c77c148ef4ea4842326a8b
---
M maintenance/sendConfirmAndMigrateEmail.php
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/61/183161/1

diff --git a/maintenance/sendConfirmAndMigrateEmail.php 
b/maintenance/sendConfirmAndMigrateEmail.php
index 49bebc6..4ab7cef 100644
--- a/maintenance/sendConfirmAndMigrateEmail.php
+++ b/maintenance/sendConfirmAndMigrateEmail.php
@@ -26,6 +26,13 @@
         */
        private $sendToConfirmed;
 
+       /**
+        * How long to wait in between emails
+        *
+        * @var int
+        */
+       private $sleep;
+
        public function __construct() {
                parent::__construct();
                $this->mDescription = "Resends the 'confirm your email address 
email' with a link to Special:MergeAccount";
@@ -37,10 +44,12 @@
                $this->addOption( 'userlist', 'List of usernames', false, true 
);
                $this->addOption( 'username', 'The user name to migrate', 
false, true, 'u' );
                $this->addOption( 'confirmed', 'Send email to confirmed 
accounts', false, false );
+               $this->addOption( 'sleep', 'How long to wait in between 
emails', false, true );
        }
 
        public function execute() {
                $this->sendToConfirmed = $this->getOption( 'confirmed', false );
+               $this->sleep = $this->getOption( 'sleep', 1 );
 
                // check to see if we are processing a single username
                if ( $this->getOption( 'username', false ) !== false ) {
@@ -114,6 +123,7 @@
 
                if ( $user->sendConfirmAndMigrateMail() ) {
                        $this->sent++;
+                       sleep( $this->sleep );
                } else {
                        $this->output( "ERROR: Sending confirm and migrate 
email failed for '$username@$wikiID'\n" );
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6005f494faec3668f3c77c148ef4ea4842326a8b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>

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

Reply via email to