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

fix: cluster.activate() should not start reconnect on init (if not accessible)

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2020-09-10 18:18:18 +03:00
parent 2467b901d9
commit 4be1988ea5
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ export const clusterIpc = {
const cluster = clusterStore.getById(clusterId); const cluster = clusterStore.getById(clusterId);
if (cluster) { if (cluster) {
if (frameId) cluster.frameId = frameId; // save cluster's webFrame.routingId to be able to send push-updates if (frameId) cluster.frameId = frameId; // save cluster's webFrame.routingId to be able to send push-updates
return cluster.activate(); return cluster.activate(true);
} }
}, },
}), }),

View File

@ -2,7 +2,7 @@ import type { ClusterId, ClusterModel, ClusterPreferences } from "../common/clus
import type { IMetricsReqParams } from "../renderer/api/endpoints/metrics.api"; import type { IMetricsReqParams } from "../renderer/api/endpoints/metrics.api";
import type { WorkspaceId } from "../common/workspace-store"; import type { WorkspaceId } from "../common/workspace-store";
import type { FeatureStatusMap } from "./feature" 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 { apiKubePrefix } from "../common/vars";
import { broadcastIpc } from "../common/ipc"; import { broadcastIpc } from "../common/ipc";
import { ContextHandler } from "./context-handler" import { ContextHandler } from "./context-handler"
@ -124,13 +124,13 @@ export class Cluster implements ClusterModel {
this.eventDisposers.length = 0; this.eventDisposers.length = 0;
} }
async activate() { async activate(init = false) {
logger.info(`[CLUSTER]: activate`, this.getMeta()); logger.info(`[CLUSTER]: activate`, this.getMeta());
await this.whenInitialized; await this.whenInitialized;
if (!this.eventDisposers.length) { if (!this.eventDisposers.length) {
this.bindEvents(); this.bindEvents();
} }
if (this.disconnected && !this.accessible) { if (this.disconnected || (!init && !this.accessible)) {
await this.reconnect(); await this.reconnect();
} }
await this.refresh(); await this.refresh();