Merge "User: Avoid deprecated Linker::link()"
[lhc/web/wiklou.git] / includes / jobqueue / aggregator / JobQueueAggregatorRedis.php
index 906a48e..db07086 100644 (file)
@@ -18,8 +18,8 @@
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @author Aaron Schulz
  */
+use Psr\Log\LoggerInterface;
 
 /**
  * Class to handle tracking information about all queues using PhpRedis
@@ -33,6 +33,8 @@
 class JobQueueAggregatorRedis extends JobQueueAggregator {
        /** @var RedisConnectionPool */
        protected $redisPool;
+       /** @var LoggerInterface */
+       protected $logger;
        /** @var array List of Redis server addresses */
        protected $servers;
 
@@ -52,6 +54,7 @@ class JobQueueAggregatorRedis extends JobQueueAggregator {
                        : [ $params['redisServer'] ]; // b/c
                $params['redisConfig']['serializer'] = 'none';
                $this->redisPool = RedisConnectionPool::singleton( $params['redisConfig'] );
+               $this->logger = \MediaWiki\Logger\LoggerFactory::getInstance( 'redis' );
        }
 
        protected function doNotifyQueueEmpty( $wiki, $type ) {
@@ -104,7 +107,7 @@ class JobQueueAggregatorRedis extends JobQueueAggregator {
        protected function getConnection() {
                $conn = false;
                foreach ( $this->servers as $server ) {
-                       $conn = $this->redisPool->getConnection( $server );
+                       $conn = $this->redisPool->getConnection( $server, $this->logger );
                        if ( $conn ) {
                                break;
                        }
@@ -122,7 +125,7 @@ class JobQueueAggregatorRedis extends JobQueueAggregator {
 
        /**
         * @param string $name
-        * @return string
+        * @return string[]
         */
        private function decodeQueueName( $name ) {
                list( $type, $wiki ) = explode( '/', $name, 2 );