File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public function __construct() {
43
43
$ username = $ nginx_helper_admin ->options ['redis_username ' ];
44
44
$ password = $ nginx_helper_admin ->options ['redis_password ' ];
45
45
46
- if ( empty ( $ nginx_helper_admin ->options ['redis_unix_socket ' ] ) ) {
46
+ if ( ! empty ( $ nginx_helper_admin ->options ['redis_unix_socket ' ] ) ) {
47
47
$ predis_args ['path ' ] = $ nginx_helper_admin ->options ['redis_unix_socket ' ];
48
48
} else {
49
49
$ predis_args ['host ' ] = $ nginx_helper_admin ->options ['redis_hostname ' ];;
@@ -60,14 +60,15 @@ public function __construct() {
60
60
61
61
try {
62
62
$ this ->redis_object ->connect ();
63
+
64
+ if ( 0 !== $ nginx_helper_admin ->options ['redis_database ' ] ) {
65
+ $ this ->redis_object ->select ( $ nginx_helper_admin ->options ['redis_database ' ] );
66
+ }
63
67
} catch ( Exception $ e ) {
64
68
$ this ->log ( $ e ->getMessage (), 'ERROR ' );
65
69
return ;
66
70
}
67
71
68
- if ( $ nginx_helper_admin ->options ['redis_database ' ] !== 0 ) {
69
- $ this ->redis_object ->select ($ nginx_helper_admin ->options ['redis_database ' ]);
70
- }
71
72
72
73
}
73
74
You can’t perform that action at this time.
0 commit comments