Remove $wgEnotifUseJobQ
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 22 Jan 2016 04:14:44 +0000 (20:14 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 29 Jan 2016 20:24:16 +0000 (12:24 -0800)
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
docs/deferred.txt
includes/DefaultSettings.php
includes/Setup.php
includes/mail/EmailNotification.php

index d9b6dd5..566be0d 100644 (file)
@@ -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
index 495e659..b8ec76b 100644 (file)
@@ -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.
index 4d0b50e..c6c616a 100644 (file)
@@ -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.
  * @{
  */
 
index 9d434de..6c85638 100644 (file)
@@ -357,7 +357,6 @@ if ( $wgEnableEmail ) {
        $wgEnotifMaxRecips = 0;
        $wgEnotifMinorEdits = false;
        $wgEnotifRevealEditorAddress = false;
-       $wgEnotifUseJobQ = false;
        $wgEnotifUseRealName = false;
        $wgEnotifUserTalk = false;
        $wgEnotifWatchlist = false;
index f557c1a..e51b434 100644 (file)
@@ -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 );
        }
 
        /**