X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialRunJobs.php;h=e1e2049d1615cbe58de062d72a46455f6528ed5c;hb=7e350ba150404509d764c96a5ea4dbc9aa51d3ac;hp=42175537646bc5ab77850c3fdace978c5da1a66a;hpb=6da98ee84b844c9fba0d6c7fa76d8fc50bf2abbc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialRunJobs.php b/includes/specials/SpecialRunJobs.php index 4217553764..e1e2049d16 100644 --- a/includes/specials/SpecialRunJobs.php +++ b/includes/specials/SpecialRunJobs.php @@ -34,9 +34,12 @@ class SpecialRunJobs extends UnlistedSpecialPage { parent::__construct( 'RunJobs' ); } + public function doesWrites() { + return true; + } + public function execute( $par = '' ) { $this->getOutput()->disable(); - if ( wfReadOnly() ) { // HTTP 423 Locked HttpStatus::header( 423 ); @@ -49,8 +52,8 @@ class SpecialRunJobs extends UnlistedSpecialPage { return; } - $optional = array( 'maxjobs' => 0, 'maxtime' => 30, 'type' => false, 'async' => true ); - $required = array_flip( array( 'title', 'tasks', 'signature', 'sigexpiry' ) ); + $optional = [ 'maxjobs' => 0, 'maxtime' => 30, 'type' => false, 'async' => true ]; + $required = array_flip( [ 'title', 'tasks', 'signature', 'sigexpiry' ] ); $params = array_intersect_key( $this->getRequest()->getValues(), $required + $optional ); $missing = array_diff_key( $required, $params ); @@ -90,19 +93,22 @@ class SpecialRunJobs extends UnlistedSpecialPage { if ( strpos( $errstr, 'Cannot modify header information' ) !== false ) { return true; // bug T115413 } - // Delegate unhandled errors to the default handlers - return false; + // Delegate unhandled errors to the default MediaWiki handler + // so that fatal errors get proper logging (T89169) + return call_user_func_array( + 'MWExceptionHandler::handleError', func_get_args() + ); } ); } // Do all of the specified tasks... if ( in_array( 'jobs', explode( '|', $params['tasks'] ) ) ) { $runner = new JobRunner( LoggerFactory::getInstance( 'runJobs' ) ); - $response = $runner->run( array( + $response = $runner->run( [ 'type' => $params['type'], 'maxJobs' => $params['maxjobs'] ? $params['maxjobs'] : 1, 'maxTime' => $params['maxtime'] ? $params['maxjobs'] : 30 - ) ); + ] ); if ( !$params['async'] ) { print FormatJson::encode( $response, true ); }