mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Trying to fix issue with total viewer count
This commit is contained in:
@@ -168,6 +168,7 @@ io.on('connection', function(socket){
|
|||||||
lists[channel] = [];
|
lists[channel] = [];
|
||||||
}
|
}
|
||||||
lists[channel].push(guid);
|
lists[channel].push(guid);
|
||||||
|
db.collection("frontpage_lists").update({"_id": channel}, {$inc: {viewers: 1}}, function(){});
|
||||||
}
|
}
|
||||||
tot_view += 1
|
tot_view += 1
|
||||||
});
|
});
|
||||||
@@ -1203,8 +1204,10 @@ function send_ping() {
|
|||||||
lists = {};
|
lists = {};
|
||||||
offline_users = [];
|
offline_users = [];
|
||||||
tot_view = 0;
|
tot_view = 0;
|
||||||
io.emit("self_ping");
|
db.collection("frontpage_lists").update({viewers: {$gt: 0}}, {$set: {"viewers": 0}}, function(err, docs) {
|
||||||
setTimeout(send_ping, 25000);
|
io.emit("self_ping");
|
||||||
|
setTimeout(send_ping, 4000);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function left_channel(coll, guid, name, short_id, in_list, socket, change)
|
function left_channel(coll, guid, name, short_id, in_list, socket, change)
|
||||||
|
|||||||
Reference in New Issue
Block a user