Convert JobQueueDB to using the WAN cache
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 1 Nov 2015 09:05:34 +0000 (01:05 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Sun, 1 Nov 2015 09:05:34 +0000 (01:05 -0800)
Change-Id: Ie5820d1439014572ca171c9303d51a8d3938ad00

includes/jobqueue/JobQueueDB.php

index 6ecfaf4..ed2d0fa 100644 (file)
@@ -33,7 +33,7 @@ class JobQueueDB extends JobQueue {
        const MAX_JOB_RANDOM = 2147483647; // integer; 2^31 - 1, used for job_random
        const MAX_OFFSET = 255; // integer; maximum number of rows to skip
 
-       /** @var BagOStuff */
+       /** @var WANObjectCache */
        protected $cache;
 
        /** @var bool|string Name of an external DB cluster. False if not set */
@@ -48,13 +48,10 @@ class JobQueueDB extends JobQueue {
         * @param array $params
         */
        protected function __construct( array $params ) {
-               global $wgMemc;
-
                parent::__construct( $params );
 
                $this->cluster = isset( $params['cluster'] ) ? $params['cluster'] : false;
-               // Make sure that we don't use the SQL cache, which would be harmful
-               $this->cache = ( $wgMemc instanceof SqlBagOStuff ) ? new EmptyBagOStuff() : $wgMemc;
+               $this->cache = ObjectCache::getMainWANInstance();
        }
 
        protected function supportedOrders() {