Browse Source

sync redis

master
zeus 4 years ago
parent
commit
fbb06aae3b
  1. 10
      swarmlab-app/src/run/app.js

10
swarmlab-app/src/run/app.js

@ -474,7 +474,7 @@ function onCollection(err, collection) {
console.log('datauser ' + JSON.stringify(user)); console.log('datauser ' + JSON.stringify(user));
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>> '+JSON.stringify(reslog)); console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>> '+JSON.stringify(reslog));
pubClient.get(issend, function(err, object) { pubClient.get(issend, function(err, object) {
if(err == null){ if(ocject == null){
pubClient.set(issend, itemsProcessed, function(err, res) { pubClient.set(issend, itemsProcessed, function(err, res) {
io.in(user).emit("logdata", reslog); io.in(user).emit("logdata", reslog);
}); });
@ -483,7 +483,6 @@ function onCollection(err, collection) {
}); });
})() })()
}else{ }else{
pubClient.get(pathfileval, function(err, object) { pubClient.get(pathfileval, function(err, object) {
var objecttmp = JSON.parse(object); var objecttmp = JSON.parse(object);
var resob1 = {} var resob1 = {}
@ -502,19 +501,14 @@ function onCollection(err, collection) {
var user = objecttmp.user25user var user = objecttmp.user25user
//io.join(user); //io.join(user);
//io.to(user).emit(reslog); //io.to(user).emit(reslog);
//console.log("RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRr", JSON.stringify(io.sockets.adapter.rooms)); // Set { <socket.id> }
pubClient.get(issend, function(err, object) { pubClient.get(issend, function(err, object) {
if(err == null){ if(ocject == null){
pubClient.set(issend, itemsProcessed, function(err, res) { pubClient.set(issend, itemsProcessed, function(err, res) {
io.in(user).emit("logdata", reslog); io.in(user).emit("logdata", reslog);
}); });
} }
itemsProcessed++; itemsProcessed++;
}); });
//io.in(user).emit("logdata", reslog);
//itemsProcessed++;
}); });
} }
}); });

Loading…
Cancel
Save