From: Aaron Schulz Date: Fri, 11 Apr 2014 22:00:12 +0000 (-0700) Subject: Avoid site outages due to broken job queues X-Git-Tag: 1.31.0-rc.0~16213^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=2eac3278a423b0af6cd0e9469f6880bbae28d8e1;p=lhc%2Fweb%2Fwiklou.git Avoid site outages due to broken job queues Change-Id: I71f1bef886850679812e23b8a49fc9b80d9b6102 --- diff --git a/includes/Wiki.php b/includes/Wiki.php index fbafba8139..68355046aa 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -651,8 +651,13 @@ class MediaWiki { return; } - if ( !JobQueueGroup::singleton()->queuesHaveJobs( JobQueueGroup::TYPE_DEFAULT ) ) { - return; // do not send request if there are probably no jobs + try { + if ( !JobQueueGroup::singleton()->queuesHaveJobs( JobQueueGroup::TYPE_DEFAULT ) ) { + return; // do not send request if there are probably no jobs + } + } catch ( JobQueueError $e ) { + MWExceptionHandler::logException( $e ); + return; // do not make the site unavailable } $query = array( 'title' => 'Special:RunJobs',