Skip to content
Browse files

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

… off clocks
  • Loading branch information...
1 parent 7e1c87f commit a9e26ce85860385ffeb158a42fd9f99c38255fcf @zquestz committed Jul 29, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 simplechat.js
View
4 simplechat.js
@@ -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.
Something went wrong with that request. Please try again.