From 334e8f8f9d6b6589f404b0de8daba9412bf6907a Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 21 Jan 2016 20:14:44 -0800 Subject: [PATCH] Remove $wgEnotifUseJobQ Always treat this as on and simplify the code. This will also make it easier to move updateWatchlistTimestamp() into the EnotifNotifyJob class to avoid query timeouts. Change-Id: I8ceaa42cdcfe3ad00a26368be6a73052be329045 --- RELEASE-NOTES-1.27 | 1 + docs/deferred.txt | 2 +- includes/DefaultSettings.php | 7 ------ includes/Setup.php | 1 - includes/mail/EmailNotification.php | 39 ++++++++++------------------- 5 files changed, 15 insertions(+), 35 deletions(-) diff --git a/RELEASE-NOTES-1.27 b/RELEASE-NOTES-1.27 index d9b6dd54da..566be0d79c 100644 --- a/RELEASE-NOTES-1.27 +++ b/RELEASE-NOTES-1.27 @@ -94,6 +94,7 @@ production. * LoginForm::getLoginToken() and LoginForm::getCreateaccountToken() return a MediaWiki\Session\Token, and tokens must be checked using that class's methods. +* $wgEnotifUseJobQ was removed and the job queue is always used. === New features in 1.27 === * $wgDataCenterId and $wgDataCenterRoles where added, which will serve as diff --git a/docs/deferred.txt b/docs/deferred.txt index 495e6594b7..b8ec76bdb0 100644 --- a/docs/deferred.txt +++ b/docs/deferred.txt @@ -33,4 +33,4 @@ Currently there are a few different types of jobs: Each job clears $wgUpdateRowsPerJob pages (500 by default). enotifNotify - Used when $wgEnotifUseJobQ is true to send mail using the job queue. + Used to send mail using the job queue. diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 4d0b50edd8..c6c616ae06 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1628,12 +1628,6 @@ $wgEnotifImpersonal = false; */ $wgEnotifMaxRecips = 500; -/** - * Send mails via the job queue. This can be useful to reduce the time it - * takes to save a page that a lot of people are watching. - */ -$wgEnotifUseJobQ = false; - /** * Use real name instead of username in e-mail "from" field. */ @@ -7690,7 +7684,6 @@ $wgHTTPConnectTimeout = 5e0; /************************************************************************//** * @name Job queue - * See also $wgEnotifUseJobQ. * @{ */ diff --git a/includes/Setup.php b/includes/Setup.php index 9d434ded7f..6c856389d7 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -357,7 +357,6 @@ if ( $wgEnableEmail ) { $wgEnotifMaxRecips = 0; $wgEnotifMinorEdits = false; $wgEnotifRevealEditorAddress = false; - $wgEnotifUseJobQ = false; $wgEnotifUseRealName = false; $wgEnotifUserTalk = false; $wgEnotifWatchlist = false; diff --git a/includes/mail/EmailNotification.php b/includes/mail/EmailNotification.php index f557c1abd0..e51b4341eb 100644 --- a/includes/mail/EmailNotification.php +++ b/includes/mail/EmailNotification.php @@ -138,7 +138,7 @@ class EmailNotification { public function notifyOnPageChange( $editor, $title, $timestamp, $summary, $minorEdit, $oldid = false, $pageStatus = 'changed' ) { - global $wgEnotifUseJobQ, $wgEnotifMinorEdits, $wgUsersNotifiedOnAllChanges, $wgEnotifUserTalk; + global $wgEnotifMinorEdits, $wgUsersNotifiedOnAllChanges, $wgEnotifUserTalk; if ( $title->getNamespace() < 0 ) { return; @@ -170,31 +170,18 @@ class EmailNotification { return; } - if ( $wgEnotifUseJobQ ) { - $params = array( - 'editor' => $editor->getName(), - 'editorID' => $editor->getID(), - 'timestamp' => $timestamp, - 'summary' => $summary, - 'minorEdit' => $minorEdit, - 'oldid' => $oldid, - 'watchers' => $watchers, - 'pageStatus' => $pageStatus - ); - $job = new EnotifNotifyJob( $title, $params ); - JobQueueGroup::singleton()->lazyPush( $job ); - } else { - $this->actuallyNotifyOnPageChange( - $editor, - $title, - $timestamp, - $summary, - $minorEdit, - $oldid, - $watchers, - $pageStatus - ); - } + $params = array( + 'editor' => $editor->getName(), + 'editorID' => $editor->getID(), + 'timestamp' => $timestamp, + 'summary' => $summary, + 'minorEdit' => $minorEdit, + 'oldid' => $oldid, + 'watchers' => $watchers, + 'pageStatus' => $pageStatus + ); + $job = new EnotifNotifyJob( $title, $params ); + JobQueueGroup::singleton()->lazyPush( $job ); } /** -- 2.20.1