Browse Source

mongo tail

master
zeus 4 years ago
parent
commit
3039d41f79
  1. 7
      swarmlab-app/src/run/app.js

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

@ -404,11 +404,16 @@ function onCollection(err, collection) {
// cursorStream = cursor.stream(),
var itemsProcessed = 0;
var reslog = new Object();
var now = new Date();
//cursorStream.on('data', function (data) {
cursor.on('data', function (data) {
reslog.log = data
reslog.date = convertDateToUTC(now)
console.log('data ' + data.value);
var user = "anagnostopoulos@uniwa.gr"
io.in(user).emit("logdata", data.value);
//io.in(user).emit("logdata", data.value);
io.in(user).emit("logdata", reslog);
itemsProcessed++;
});

Loading…
Cancel
Save