1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

check connection every 5m

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2021-01-25 15:08:04 +02:00
parent 14a0c9cdca
commit acd8940e0d

View File

@ -93,7 +93,7 @@ export class KubeWatchApi {
window.addEventListener("online", () => this.connect());
window.addEventListener("offline", () => this.disconnect());
setInterval(() => this.connectionCheck(), 30000);
setInterval(() => this.connectionCheck(), 60000 * 5); // every 5m
}
getSubscribersCount(api: KubeApi) {
@ -156,6 +156,11 @@ export class KubeWatchApi {
}
protected connectionCheck() {
this.log({
message: "connection check",
meta: { connected: this.isConnected },
});
if (this.isConnected) return;
return this.connect();