From: Aaron Schulz Date: Fri, 8 Feb 2013 18:09:41 +0000 (-0800) Subject: Fixed some comments and removed redundant constant. X-Git-Tag: 1.31.0-rc.0~20724 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=abd562162c23b4914a2853d71d49bd573ef6aff1;p=lhc%2Fweb%2Fwiklou.git Fixed some comments and removed redundant constant. * Also normalized params in RedisConnectionPool to avoid fragmentation. Change-Id: I803dae52262b974836817d2091725f044faf7022 --- diff --git a/includes/clientpool/RedisConnectionPool.php b/includes/clientpool/RedisConnectionPool.php index 95a0afa1ba..eace85ad71 100644 --- a/includes/clientpool/RedisConnectionPool.php +++ b/includes/clientpool/RedisConnectionPool.php @@ -28,7 +28,7 @@ * This can be used to get handle wrappers that free the handle when the wrapper * leaves scope. The maximum number of free handles (connections) is configurable. * This provides an easy way to cache connection handles that may also have state, - * such as handle does between multi() and exec(), and without hoarding connections. + * such as a handle does between multi() and exec(), and without hoarding connections. * The wrappers use PHP magic methods so that calling functions on them calls the * function of the actual Redis object handle. * @@ -98,6 +98,7 @@ class RedisConnectionPool { * @return RedisConnectionPool */ public static function singleton( array $options ) { + ksort( $options ); // normalize $id = sha1( serialize( $options ) ); if ( !isset( self::$instances[$id] ) ) { self::$instances[$id] = new self( $options ); diff --git a/includes/job/JobQueueRedis.php b/includes/job/JobQueueRedis.php index 6c908a28c3..3e7a47c2df 100644 --- a/includes/job/JobQueueRedis.php +++ b/includes/job/JobQueueRedis.php @@ -35,7 +35,6 @@ class JobQueueRedis extends JobQueue { const ROOTJOB_TTL = 1209600; // integer; seconds to remember root jobs (14 days) const MAX_AGE_PRUNE = 604800; // integer; seconds a job can live once claimed (7 days) - const MAX_ATTEMPTS = 3; // integer; number of times to try a job /** * @params include: @@ -137,7 +136,7 @@ class JobQueueRedis extends JobQueue { $conn = $this->getConnection(); try { - // Find which of these jobs are duplicates unclaimed jobs in the queue... + // Find which of these jobs are duplicates of unclaimed jobs in the queue... if ( count( $dedupUids ) ) { $conn->multi( Redis::PIPELINE ); foreach ( $dedupUids as $uid ) { // check if job data exists