Browse Source

sync redis

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

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

@ -474,7 +474,7 @@ function onCollection(err, collection) {
console.log('datauser ' + JSON.stringify(user));
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>> '+JSON.stringify(reslog));
pubClient.get(issend, function(err, object) {
if(err == null){
if(ocject == null){
pubClient.set(issend, itemsProcessed, function(err, res) {
io.in(user).emit("logdata", reslog);
});
@ -483,41 +483,35 @@ function onCollection(err, collection) {
});
})()
}else{
pubClient.get(pathfileval, function(err, object) {
var objecttmp = JSON.parse(object);
var resob1 = {}
resob1.data = objecttmp.res25swarmlabname
resob1.user25user = objecttmp.res25user
resob1.res25creator = objecttmp.res25creator
resob1.res25fileforce = objecttmp.res25fileforce
resob1.tailed_path = objecttmp.tailed_path
reslog.data = resob1
reslog.log = data
reslog.date = convertDateToUTC(now)
console.log('<<<<<<<<<<<---------------------<<<<<<<<<<<<<<<---------------------------<<<<<<<<<<<< '+JSON.stringify(object));
console.log('<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< '+JSON.stringify(reslog));
var user = objecttmp.user25user
//io.join(user);
//io.to(user).emit(reslog);
//console.log("RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRr", JSON.stringify(io.sockets.adapter.rooms)); // Set { <socket.id> }
pubClient.get(issend, function(err, object) {
if(err == null){
pubClient.set(issend, itemsProcessed, function(err, res) {
io.in(user).emit("logdata", reslog);
});
}
itemsProcessed++;
pubClient.get(pathfileval, function(err, object) {
var objecttmp = JSON.parse(object);
var resob1 = {}
resob1.data = objecttmp.res25swarmlabname
resob1.user25user = objecttmp.res25user
resob1.res25creator = objecttmp.res25creator
resob1.res25fileforce = objecttmp.res25fileforce
resob1.tailed_path = objecttmp.tailed_path
reslog.data = resob1
reslog.log = data
reslog.date = convertDateToUTC(now)
console.log('<<<<<<<<<<<---------------------<<<<<<<<<<<<<<<---------------------------<<<<<<<<<<<< '+JSON.stringify(object));
console.log('<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< '+JSON.stringify(reslog));
var user = objecttmp.user25user
//io.join(user);
//io.to(user).emit(reslog);
pubClient.get(issend, function(err, object) {
if(ocject == null){
pubClient.set(issend, itemsProcessed, function(err, res) {
io.in(user).emit("logdata", reslog);
});
}
itemsProcessed++;
});
});
//io.in(user).emit("logdata", reslog);
//itemsProcessed++;
});
}
});
}
});
});

Loading…
Cancel
Save