Added location reload if eventSource loose connection

pull/18/head
Sami Mokaddem 2017-10-23 17:31:33 +02:00
parent 14103fb0a7
commit 13305e627f
2 changed files with 4 additions and 2 deletions

View File

@ -114,7 +114,8 @@ $(document).ready(function () {
};
source_log.onerror = function(){
//console.log('error: '+source_log.readyState);
console.log('error: '+source_log.readyState);
setTimeout(function() { location.reload(); }, 5000);
};
source_log.onmessage = function(event) {

View File

@ -171,5 +171,6 @@ source_map.onopen = function(){
console.log('connection is opened. '+source_map.readyState);
};
source_map.onerror = function(){
console.log('error: '+source_map.readyState);
console.log('error: '+source_map.readyState);
setTimeout(function() { location.reload(); }, 5000);
};