mirror of https://github.com/zulip/zulip.git
Fix repeated get_updates resets due to unsuspend event handler errors.
(imported from commit 6d303e84b4320c23a5f16260f859a943dc942836)
This commit is contained in:
parent
bdcc2e5c52
commit
71a55808f7
|
@ -1196,6 +1196,9 @@ var watchdog_time = $.now();
|
|||
setInterval(function () {
|
||||
var new_time = $.now();
|
||||
if ((new_time - watchdog_time) > 20000) { // 20 seconds.
|
||||
// Defensively reset watchdog_time here in case there's an
|
||||
// exception in one of the event handlers
|
||||
watchdog_time = new_time;
|
||||
// Our app's JS wasn't running, which probably means the machine was
|
||||
// asleep.
|
||||
$(document).trigger($.Event('unsuspend'));
|
||||
|
|
Loading…
Reference in New Issue