diff options
author | diosmosis <benaka@piwik.pro> | 2015-06-25 14:18:27 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-06-25 14:18:27 +0300 |
commit | 0bbf109040038bdb4ec4f4200ca3f85546178d28 (patch) | |
tree | e4128b1f8e28432eea94576877cb069381d3b32d /js/piwik.js | |
parent | 8b4a1c7b369320c34df71db84da5f1eb825db0e8 (diff) |
Fix configHeartBeatDelay rename, shouldn't have renamed that variable to ...InSeconds since its in milliseconds.
Diffstat (limited to 'js/piwik.js')
-rw-r--r-- | js/piwik.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/js/piwik.js b/js/piwik.js index cfd8151a79..ceaa1453ec 100644 --- a/js/piwik.js +++ b/js/piwik.js @@ -2198,7 +2198,7 @@ if (typeof Piwik !== 'object') { configMinimumVisitTime, // Recurring heart beat after initial ping (in milliseconds) - configHeartBeatDelayInSeconds, + configHeartBeatDelay, // alias to circumvent circular function dependency (JSLint requires this) heartBeatPingIfActivityAlias, @@ -2495,7 +2495,7 @@ if (typeof Piwik !== 'object') { */ function heartBeatUp(delay) { if (heartBeatTimeout - || !configHeartBeatDelayInSeconds + || !configHeartBeatDelay ) { return; } @@ -2507,11 +2507,11 @@ if (typeof Piwik !== 'object') { } var now = new Date(), - heartBeatDelay = configHeartBeatDelayInSeconds - (now.getTime() - lastTrackerRequestTime); + heartBeatDelay = configHeartBeatDelay - (now.getTime() - lastTrackerRequestTime); // sanity check - heartBeatDelay = Math.min(configHeartBeatDelayInSeconds, heartBeatDelay); + heartBeatDelay = Math.min(configHeartBeatDelay, heartBeatDelay); heartBeatUp(heartBeatDelay); - }, delay || configHeartBeatDelayInSeconds); + }, delay || configHeartBeatDelay); } /* @@ -2531,7 +2531,7 @@ if (typeof Piwik !== 'object') { */ function setUpHeartBeat() { if (heartBeatSetUp - || !configHeartBeatDelayInSeconds + || !configHeartBeatDelay ) { return; } @@ -3163,12 +3163,12 @@ if (typeof Piwik !== 'object') { } /* - * If there was user activity since the last check, and it's been configHeartBeatDelayInSeconds seconds + * If there was user activity since the last check, and it's been configHeartBeatDelay seconds * since the last tracker, send a ping request (the heartbeat timeout will be reset by sendRequest). */ heartBeatPingIfActivityAlias = function heartBeatPingIfActivity() { var now = new Date(); - if (lastTrackerRequestTime + configHeartBeatDelayInSeconds <= now.getTime()) { + if (lastTrackerRequestTime + configHeartBeatDelay <= now.getTime()) { var requestPing = getRequest('ping=1', null, 'ping'); sendRequest(requestPing, configTrackerPause); @@ -5006,7 +5006,7 @@ if (typeof Piwik !== 'object') { */ enableHeartBeatTimer: function (heartBeatDelayInSeconds) { heartBeatDelayInSeconds = Math.max(heartBeatDelayInSeconds, 1); - configHeartBeatDelayInSeconds = (heartBeatDelayInSeconds || 15) * 1000; + configHeartBeatDelay = (heartBeatDelayInSeconds || 15) * 1000; // if a tracking request has already been sent, start the heart beat timeout if (lastTrackerRequestTime !== null) { @@ -5020,7 +5020,7 @@ if (typeof Piwik !== 'object') { */ disableHeartBeatTimer: function () { heartBeatDown(); - configHeartBeatDelayInSeconds = null; + configHeartBeatDelay = null; }, /*</DEBUG>*/ |