X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpoolcounter%2FPoolCounterRedis.php;h=c89dc15693c5feda205ceeafa233d1fc1693f1bb;hb=0eb97872a54229f5c9892a1202882997a50d7e37;hp=5a15ddf6bb8dc38e236e3410dc48638f98e1f8e4;hpb=2d63ce056d50d589b48addafd1c812b18711e0a7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/poolcounter/PoolCounterRedis.php b/includes/poolcounter/PoolCounterRedis.php index 5a15ddf6bb..c89dc15693 100644 --- a/includes/poolcounter/PoolCounterRedis.php +++ b/includes/poolcounter/PoolCounterRedis.php @@ -16,7 +16,6 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @author Aaron Schulz */ use Psr\Log\LoggerInterface; @@ -86,7 +85,9 @@ class PoolCounterRedis extends PoolCounter { parent::__construct( $conf, $type, $key ); $this->serversByLabel = $conf['servers']; - $this->ring = new HashRing( array_fill_keys( array_keys( $conf['servers'] ), 100 ) ); + + $serverLabels = array_keys( $conf['servers'] ); + $this->ring = new HashRing( array_fill_keys( $serverLabels, 10 ) ); $conf['redisConfig']['serializer'] = 'none'; // for use with Lua $this->pool = RedisConnectionPool::singleton( $conf['redisConfig'] ); @@ -151,9 +152,11 @@ class PoolCounterRedis extends PoolCounter { if ( !$status->isOK() ) { return $status; } + /** @var RedisConnRef $conn */ $conn = $status->value; + '@phan-var RedisConnRef $conn'; - // @codingStandardsIgnoreStart Generic.Files.LineLength + // phpcs:disable Generic.Files.LineLength static $script = /** @lang Lua */ <<luaEval( $script, @@ -237,7 +240,9 @@ LUA; if ( !$status->isOK() ) { return $status; } + /** @var RedisConnRef $conn */ $conn = $status->value; + '@phan-var RedisConnRef $conn'; $now = microtime( true ); try {