Skip to content

Commit

Permalink
Merge pull request #1072 from matheod/karmaIsBitchWhenDidntUpdate
Browse files Browse the repository at this point in the history
Avoid timezone problem
  • Loading branch information
matheod committed May 15, 2014
2 parents 2879d1b + 6df0831 commit f889bc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ RESUtils.getUserInfo = function(callback, username, live) {
var lastCheck = (userInfoCache !== null) ? parseInt(userInfoCache.lastCheck, 10) || 0 : 0;
var now = Date.now();
// 300000 = 5 minutes
if (live && (now - lastCheck) > 300000) {
if (live && ((now - lastCheck) > 300000) || lastCheck > now) { // avoid timezone problem
if (!RESUtils.userInfoRunning) {
RESUtils.userInfoRunning = true;
GM_xmlhttpRequest({
Expand Down

0 comments on commit f889bc3

Please sign in to comment.