Parcourir la source

Make multiple explicit calls to Predis\Client::connect() possible.

Daniele Alessandri il y a 14 ans
Parent
commit
b3e7cfe408
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      lib/Predis.php

+ 3 - 1
lib/Predis.php

@@ -123,7 +123,9 @@ class Client {
     }
 
     public function connect() {
-        $this->_connection->connect();
+        if (!$this->_connection->isConnected()) {
+            $this->_connection->connect();
+        }
     }
 
     public function disconnect() {