From f8ac2662876e8f52f6ca9a4412275a894abb0a9a Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Sun, 20 May 2018 14:10:20 +0200 Subject: [PATCH] Job: Remove insert() and batchInsert(), deprecated since 1.21 Bug: T179624 Change-Id: I0d78a926c8c513fd652a424e8a51ded20e524a4a --- RELEASE-NOTES-1.32 | 2 ++ includes/jobqueue/Job.php | 31 +------------------------------ includes/jobqueue/JobQueue.php | 2 +- includes/jobqueue/JobQueueDB.php | 2 +- 4 files changed, 5 insertions(+), 32 deletions(-) diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index b19c6a14a5..33ef49b5e3 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -98,6 +98,8 @@ because of Phabricator reports. * The Html5Internal and Html5Depurate tidy driver classes were removed, along with the Balancer tidy implementation. Both implementations were experimental, and were replaced by RemexHtml. +* (T179624) Job::insert() and ::batchInsert(), deprecated in 1.21, were both + removed. Use JobQueueGroup::singleton()->push() instead. === Deprecations in 1.32 === * Use of a StartProfiler.php file is deprecated in favour of placing diff --git a/includes/jobqueue/Job.php b/includes/jobqueue/Job.php index f9c416f3af..b16cfa3819 100644 --- a/includes/jobqueue/Job.php +++ b/includes/jobqueue/Job.php @@ -23,8 +23,7 @@ /** * Class to both describe a background job and handle jobs. - * The queue aspects of this class are now deprecated. - * Using the class to push jobs onto queues is deprecated (use JobSpecification). + * To push jobs onto queues, use JobQueueGroup::singleton()->push(); * * @ingroup JobQueue */ @@ -123,23 +122,6 @@ abstract class Job implements IJobSpecification { return ( $this->executionFlags && $flag ) === $flag; } - /** - * Batch-insert a group of jobs into the queue. - * This will be wrapped in a transaction with a forced commit. - * - * This may add duplicate at insert time, but they will be - * removed later on, when the first one is popped. - * - * @param Job[] $jobs Array of Job objects - * @return bool - * @deprecated since 1.21 - */ - public static function batchInsert( $jobs ) { - wfDeprecated( __METHOD__, '1.21' ); - JobQueueGroup::singleton()->push( $jobs ); - return true; - } - /** * @return string */ @@ -346,17 +328,6 @@ abstract class Job implements IJobSpecification { } } - /** - * Insert a single job into the queue. - * @return bool True on success - * @deprecated since 1.21 - */ - public function insert() { - wfDeprecated( __METHOD__, '1.21' ); - JobQueueGroup::singleton()->push( $this ); - return true; - } - /** * @return string */ diff --git a/includes/jobqueue/JobQueue.php b/includes/jobqueue/JobQueue.php index 1f4f179a67..d2446abbfa 100644 --- a/includes/jobqueue/JobQueue.php +++ b/includes/jobqueue/JobQueue.php @@ -472,7 +472,7 @@ abstract class JobQueue { $params = $job->getRootJobParams(); $key = $this->getRootJobCacheKey( $params['rootJobSignature'] ); - // Callers should call batchInsert() and then this function so that if the insert + // Callers should call JobQueueGroup::push() before this method so that if the insert // fails, the de-duplication registration will be aborted. Since the insert is // deferred till "transaction idle", do the same here, so that the ordering is // maintained. Having only the de-duplication registration succeed would cause diff --git a/includes/jobqueue/JobQueueDB.php b/includes/jobqueue/JobQueueDB.php index c13f5396af..a082d647f2 100644 --- a/includes/jobqueue/JobQueueDB.php +++ b/includes/jobqueue/JobQueueDB.php @@ -500,7 +500,7 @@ class JobQueueDB extends JobQueue { throw new MWException( "Cannot register root job; missing 'rootJobTimestamp'." ); } $key = $this->getRootJobCacheKey( $params['rootJobSignature'] ); - // Callers should call batchInsert() and then this function so that if the insert + // Callers should call JobQueueGroup::push() before this method so that if the insert // fails, the de-duplication registration will be aborted. Since the insert is // deferred till "transaction idle", do the same here, so that the ordering is // maintained. Having only the de-duplication registration succeed would cause -- 2.20.1