diff options
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/js/js.js b/core/js/js.js index 598e0dcd185..802b5de7e18 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1498,9 +1498,15 @@ function initCore() { interval = maxInterval; } var url = OC.generateUrl('/heartbeat'); - setInterval(function(){ - $.post(url); - }, interval * 1000); + var heartBeatTimeout = null; + var heartBeat = function() { + clearTimeout(heartBeatTimeout); + heartBeatTimeout = setInterval(function() { + $.post(url); + }, interval * 1000); + }; + $(document).ajaxComplete(heartBeat); + heartBeat(); } // session heartbeat (defaults to enabled) |