Legoktm has uploaded a new change for review.

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

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, 12 insertions(+), 2 deletions(-)


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

diff --git a/LocalRenameUserJob.php b/LocalRenameUserJob.php
index 2cb724e..8ca9e3a 100644
--- a/LocalRenameUserJob.php
+++ b/LocalRenameUserJob.php
@@ -20,8 +20,19 @@
        }
 
        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;
+               }
+       }
+
+       public function doRename() {
+               if ( !class_exists( 'RenameuserSQL' ) ) {
                        throw new MWException( 'Extension:Renameuser is not 
installed' );
                }
                $from = $this->params['from'];
@@ -42,7 +53,6 @@
                        // 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'] ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I96e331b6f55f2888a038eef0df29f5f2d238534c
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