From: Marko Obrovac Date: Thu, 19 Jul 2018 16:13:38 +0000 (+0200) Subject: JobQueueGroup: Allow readOnlyReason to be specified per JQ type X-Git-Tag: 1.34.0-rc.0~4693^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=a5aa44567b3312401d6dcb0ffc9706da7e81c629;p=lhc%2Fweb%2Fwiklou.git JobQueueGroup: Allow readOnlyReason to be specified per JQ type We use $wgReadOnly for various reasons, one of which is to disallow writes in the currently-non-active DC. However, we should allow the readOnlyReason configuration variable to be available per JobQueue type and have it the code respect that. In our current set-up, we use JobQueueEventBus which ever only uses the enqueue execution path and does not depend upon which DC it is executed in, so this will allow us to enqueue jobs in both DCs. Note that this is an alternative approach to the one outlined in Ibbad6063b6b154d7f7d172c79f7be324bf80eb7e Bug: T199594 Change-Id: I8f1a57a81ea11c1c587c0057fa8bb3454b0e0b56 --- diff --git a/includes/jobqueue/JobQueueGroup.php b/includes/jobqueue/JobQueueGroup.php index 37c8890cc9..820c492e85 100644 --- a/includes/jobqueue/JobQueueGroup.php +++ b/includes/jobqueue/JobQueueGroup.php @@ -111,7 +111,7 @@ class JobQueueGroup { $conf = $conf + $wgJobTypeConf['default']; } $conf['aggregator'] = JobQueueAggregator::singleton(); - if ( $this->readOnlyReason !== false ) { + if ( !isset( $conf['readOnlyReason'] ) ) { $conf['readOnlyReason'] = $this->readOnlyReason; }