mirror of
https://github.com/bilde2910/Hauk.git
synced 2026-01-23 02:24:09 +00:00
redis: connect before authenticating
otherwise we get "Uncaught RedisException: Redis server went away" on Redis->auth()
This commit is contained in:
parent
5ea2ff473e
commit
5c59910e54
1 changed files with 2 additions and 2 deletions
|
|
@ -8,12 +8,12 @@ class MemWrapper {
|
|||
|
||||
function __construct() {
|
||||
$this->redis = new Redis();
|
||||
$this->redis->connect(getConfig("redis_host"), getConfig("redis_port"))
|
||||
or die ("Server could not connect to Redis!\n");
|
||||
if (getConfig("redis_use_auth")) {
|
||||
$this->redis->auth(getConfig("redis_auth"))
|
||||
or die("Incorrect Redis authentication!");
|
||||
}
|
||||
$this->redis->connect(getConfig("redis_host"), getConfig("redis_port"))
|
||||
or die ("Server could not connect to Redis!\n");
|
||||
}
|
||||
|
||||
function get($key) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue