From 4be1988ea5fbd9b5ab6446ef317d597b99e861eb Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 10 Sep 2020 18:18:18 +0300 Subject: [PATCH] fix: cluster.activate() should not start reconnect on init (if not accessible) Signed-off-by: Roman --- src/common/cluster-ipc.ts | 2 +- src/main/cluster.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/cluster-ipc.ts b/src/common/cluster-ipc.ts index a2ae6cbe05..b8f9f5f84b 100644 --- a/src/common/cluster-ipc.ts +++ b/src/common/cluster-ipc.ts @@ -9,7 +9,7 @@ export const clusterIpc = { const cluster = clusterStore.getById(clusterId); if (cluster) { if (frameId) cluster.frameId = frameId; // save cluster's webFrame.routingId to be able to send push-updates - return cluster.activate(); + return cluster.activate(true); } }, }), diff --git a/src/main/cluster.ts b/src/main/cluster.ts index eb703cab8b..439668ad1d 100644 --- a/src/main/cluster.ts +++ b/src/main/cluster.ts @@ -2,7 +2,7 @@ import type { ClusterId, ClusterModel, ClusterPreferences } from "../common/clus import type { IMetricsReqParams } from "../renderer/api/endpoints/metrics.api"; import type { WorkspaceId } from "../common/workspace-store"; import type { FeatureStatusMap } from "./feature" -import { action, computed, intercept, observable, reaction, toJS, when } from "mobx"; +import { action, computed, observable, reaction, toJS, when } from "mobx"; import { apiKubePrefix } from "../common/vars"; import { broadcastIpc } from "../common/ipc"; import { ContextHandler } from "./context-handler" @@ -124,13 +124,13 @@ export class Cluster implements ClusterModel { this.eventDisposers.length = 0; } - async activate() { + async activate(init = false) { logger.info(`[CLUSTER]: activate`, this.getMeta()); await this.whenInitialized; if (!this.eventDisposers.length) { this.bindEvents(); } - if (this.disconnected && !this.accessible) { + if (this.disconnected || (!init && !this.accessible)) { await this.reconnect(); } await this.refresh();