Add oldRev parameter to DiffRevisionTools hook
[lhc/web/wiklou.git] / includes / clientpool / RedisConnectionPool.php
index f4a2fa6..8a6718f 100644 (file)
@@ -210,7 +210,7 @@ class RedisConnectionPool {
                        }
                } catch ( RedisException $e ) {
                        $this->downServers[$server] = time() + self::SERVER_DOWN_TTL;
-                       wfDebugLog( 'redis', "Redis exception: " . $e->getMessage() . "\n" );
+                       wfDebugLog( 'redis', "Redis exception connecting to $server: " . $e->getMessage() . "\n" );
 
                        return false;
                }
@@ -316,6 +316,17 @@ class RedisConnectionPool {
 
                return true;
        }
+
+       /**
+        * Make sure connections are closed for sanity
+        */
+       function __destruct() {
+               foreach ( $this->connections as $server => &$serverConnections ) {
+                       foreach ( $serverConnections as $key => &$connection ) {
+                               $connection['conn']->close();
+                       }
+               }
+       }
 }
 
 /**