Browse Source

fixed timestamp undefined, maybe

visualizer2
edoardoo 9 years ago
parent
commit
357fdce325
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      server.js

+ 5
- 3
server.js View File

@ -87,9 +87,11 @@ io.sockets.on('connection', function(socket){
leaderBoards.find().sort({timeStamp:-1}).limit(1, function(err, docs){
var parsedLb = JSON.parse(lb);
if( parsedLb.timeStamp - docs[0].timeStamp > 600000){
leaderBoards.insert(parsedLb);
console.log("Saving stats report.");
if( typeof docs[0].timeStamp != "undefined" ){
if( parsedLb.timeStamp - docs[0].timeStamp > 600000){
leaderBoards.insert(parsedLb);
console.log("Saving stats report.");
}
}
});
//


Loading…
Cancel
Save