From acd8940e0d6162b9a9f76d7e307fa86884ef3a73 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 25 Jan 2021 15:08:04 +0200 Subject: [PATCH] check connection every 5m Signed-off-by: Roman --- src/renderer/api/kube-watch-api.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/renderer/api/kube-watch-api.ts b/src/renderer/api/kube-watch-api.ts index 64af0c2e5a..f152e7312a 100644 --- a/src/renderer/api/kube-watch-api.ts +++ b/src/renderer/api/kube-watch-api.ts @@ -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();