Skip to content

Commit 3a3b655

Browse files
author
Julien Pardons
committed
Fixing redis when specify IP
1 parent 9aed0e3 commit 3a3b655

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/eBot/Application/Application.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function run()
9494
null,
9595
0,
9696
0,
97-
$config->getRedisAuthUsername() ? ['auth' => [$config->getRedisAuthUsername(), $config->getRedisAuthPassword()]] : null
97+
$config->getRedisAuthUsername() ? ['auth' => [$config->getRedisAuthUsername(), $config->getRedisAuthPassword()]] : []
9898
);
9999

100100
$time = time();

websocket/websocket.hotfix.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct($url)
2626
null,
2727
0,
2828
0,
29-
$config->getRedisAuthUsername() ? ['auth' => [$config->getRedisAuthUsername(), $config->getRedisAuthPassword()]] : null
29+
$config->getRedisAuthUsername() ? ['auth' => [$config->getRedisAuthUsername(), $config->getRedisAuthPassword()]] : []
3030
);
3131

3232
$this->client = $redis;

websocket_server.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ const config = parse(fs.readFileSync('./config/config.ini', 'utf-8'));
131131
});
132132

133133
await subscriber.subscribe(config.Redis.REDIS_CHANNEL_EBOT_TO_WS, (message) => {
134-
const messageObject = JSON.parse(message);
135-
const body = messageObject.data;
136-
let data;
134+
let messageObject, body, data;
137135
try {
136+
messageObject = JSON.parse(message)
137+
body = messageObject.data;
138138
data = JSON.parse(body);
139139
if (data.message === "ping") {
140140
return;

0 commit comments

Comments
 (0)