File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -39,16 +39,16 @@ public function getAdapter(array $config)
3939 throw new ConnectException (sprintf ('Could not connect to Redis database on "%s:%s". ' , $ config ['host ' ], $ config ['port ' ]));
4040 }
4141 } else {
42+ if (false === $ client ->connect ($ dsn ->getFirstHost (), $ dsn ->getFirstPort ())) {
43+ throw new ConnectException (sprintf ('Could not connect to Redis database on "%s:%s". ' , $ dsn ->getFirstHost (), $ dsn ->getFirstPort ()));
44+ }
45+
4246 if (!empty ($ dsn ->getPassword ())) {
4347 if (false === $ client ->auth ($ dsn ->getPassword ())) {
4448 throw new ConnectException ('Could not connect authenticate connection to Redis database. ' );
4549 }
4650 }
4751
48- if (false === $ client ->connect ($ dsn ->getFirstHost (), $ dsn ->getFirstPort ())) {
49- throw new ConnectException (sprintf ('Could not connect to Redis database on "%s:%s". ' , $ dsn ->getFirstHost (), $ dsn ->getFirstPort ()));
50- }
51-
5252 if ($ dsn ->getDatabase () !== null ) {
5353 if (false === $ client ->select ($ dsn ->getDatabase ())) {
5454 throw new ConnectException (sprintf ('Could not select Redis database with index "%s". ' , $ dsn ->getDatabase ()));
You can’t perform that action at this time.
0 commit comments