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

Change subject: LocalRenameUserJob: Set 'failed' status for any exception thrown
......................................................................


LocalRenameUserJob: Set 'failed' status for any exception thrown

Otherwise the job will indefinitely be 'inprogress'

Change-Id: I96e331b6f55f2888a038eef0df29f5f2d238534c
---
M LocalRenameUserJob.php
1 file changed, 14 insertions(+), 3 deletions(-)

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



diff --git a/LocalRenameUserJob.php b/LocalRenameUserJob.php
index 2cb724e..0f1a83e 100644
--- a/LocalRenameUserJob.php
+++ b/LocalRenameUserJob.php
@@ -20,8 +20,21 @@
        }
 
        public function run() {
-               if ( !class_exists( 'RenameuserSQL' ) ) {
+               $this->renameuserStatus = new GlobalRenameUserStatus( 
$this->params['from'] );
+               try {
+                       $this->doRename();
+               } catch ( Exception $e ) {
+                       // This will lock the user out of their account
+                       // until a sysadmin intervenes
                        $this->updateStatus( 'failed' );
+                       throw $e;
+               }
+
+               return true;
+       }
+
+       public function doRename() {
+               if ( !class_exists( 'RenameuserSQL' ) ) {
                        throw new MWException( 'Extension:Renameuser is not 
installed' );
                }
                $from = $this->params['from'];
@@ -42,14 +55,12 @@
                        // This should never happen!
                        // If it does happen, the user will be locked out of 
their account
                        // until a sysadmin intervenes...
-                       $this->updateStatus( 'failed' );
                        throw new MWException( 'RenameuserSQL::rename returned 
false.' );
                }
                if ( $this->params['movepages'] ) {
                        $this->movePages();
                }
                $this->done();
-               return true;
        }
 
        /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I96e331b6f55f2888a038eef0df29f5f2d238534c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: CSteipp <cste...@wikimedia.org>
Gerrit-Reviewer: Hoo man <h...@online.de>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
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