Commit c4384ce9 authored by marioromera's avatar marioromera
Browse files

try aprsing redis message

parent d9caed6d
......@@ -30,8 +30,13 @@ module.exports = io => {
redis_connected = true;
subscriber.subscribe(`pad:${PAD_ID}`);
subscriber.on('message', (channel, message) => {
logger.warn('Pad updated', message);
(async () => {
logger.warn('Pad updated', message);
try {
message = JSON.parse(message);
} catch (e) {
logger.error('redis message not parseable');
}
if (
message &&
message.message &&
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment