diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index 64ef898..b594aa6 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -10,7 +10,6 @@ var io = require('socket.io')(http); const createAdapter = require('socket.io-redis'); //import { RedisClient } from 'redis'; const RedisClient = require("redis"); -//const pubClient = redis.createClient({ host: 'localhost', port: 6379 } ); const pubClient = RedisClient.createClient(); //const pubClient = new RedisClient({ host: 'localhost', port: 6379 }); @@ -18,7 +17,7 @@ const subClient = pubClient.duplicate(); io.adapter(createAdapter({ pubClient, subClient })); -RedisClient.on("connect", function() { +pubClient.on("connect", function() { console.log("You are now connected"); }); @@ -436,8 +435,8 @@ function onCollection(err, collection) { resob1.res25fileforce = resdata.data[i].res25fileforce resob1.tailed_path = pathfileval //resobarray.push(resob1) - RedisClient.hmset(pathfileval,JSON.stringify(resob1)) - RedisClient.hgetall(pathfileval, function(err, object) { + pubClient.hmset(pathfileval,JSON.stringify(resob1)) + pubClient.hgetall(pathfileval, function(err, object) { console.log('redis '+object); }); }