add automatic backoff when server is at capacity

This commit is contained in:
Jakob Ketterl
2020-01-10 21:38:46 +01:00
parent 5a57648eec
commit cbd87abc3d
2 changed files with 16 additions and 3 deletions

View File

@ -1145,7 +1145,12 @@ function on_ws_recv(evt) {
break;
case 'pocsag_data':
update_pocsag_panel(json['value']);
break
break;
case 'backoff':
divlog("Server is currently busy: " + json['reason'], true);
// set a higher reconnection timeout right away to avoid additional load
reconnect_timeout = 16000;
break;
default:
console.warn('received message of unknown type: ' + json['type']);
}