Permalink
Browse files

Allow for minor fluxuations in message time to accomodate people with…

… off clocks
  • Loading branch information...
zquestz committed Jul 29, 2012
1 parent 7e1c87f commit a9e26ce85860385ffeb158a42fd9f99c38255fcf
Showing with 3 additions and 1 deletion.
  1. +3 −1 simplechat.js
View
@@ -163,11 +163,13 @@ if (Meteor.is_server) {
Meteor.setInterval(function () {
var now = (new Date()).getTime();
+ var date = (new Date());
+ date.setSeconds(date.getSeconds() + 10);
Users.remove({last_seen: {$lt: (now - 60 * 1000)}});
Users.remove({last_seen: {$gt: (now + 30)}});
Users.remove({last_seen: {$exists: false}});
- Messages.remove({date: {$gt: new Date().toISOString()}});
+ Messages.remove({date: {$gt: date.toISOString()}});
}, 1000);
Meteor.methods({

0 comments on commit a9e26ce

Please sign in to comment.