Skip to content

Commit

Permalink
[wsman-bridge] Lint typescript files
Browse files Browse the repository at this point in the history
  • Loading branch information
easyCZ authored and roboquat committed Apr 21, 2022
1 parent 977ca58 commit 9bec4a3
Show file tree
Hide file tree
Showing 13 changed files with 348 additions and 253 deletions.
6 changes: 3 additions & 3 deletions components/ws-manager-bridge/ee/src/container-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* See License.enterprise.txt in the project root folder.
*/

import { ContainerModule } from 'inversify';
import { WorkspaceManagerBridgeEE } from './bridge';
import { WorkspaceManagerBridge } from '../../src/bridge';
import { ContainerModule } from "inversify";
import { WorkspaceManagerBridgeEE } from "./bridge";
import { WorkspaceManagerBridge } from "../../src/bridge";

export const containerModuleEE = new ContainerModule((bind, unbind, isBound, rebind) => {
rebind(WorkspaceManagerBridge).to(WorkspaceManagerBridgeEE).inRequestScope();
Expand Down
2 changes: 1 addition & 1 deletion components/ws-manager-bridge/ee/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* See License.enterprise.txt in the project root folder.
*/

require('reflect-metadata');
require("reflect-metadata");

import { Container } from "inversify";
import { containerModuleEE } from "./container-module";
Expand Down
27 changes: 15 additions & 12 deletions components/ws-manager-bridge/src/bridge-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
import { inject, injectable, interfaces } from "inversify";
import { WorkspaceClusterInfo, WorkspaceManagerBridge, WorkspaceManagerBridgeFactory } from "./bridge";
import { Configuration } from "./config";
import { WorkspaceManagerClientProvider } from '@gitpod/ws-manager/lib/client-provider';
import { WorkspaceManagerClientProviderSource } from '@gitpod/ws-manager/lib/client-provider-source';
import { log } from '@gitpod/gitpod-protocol/lib/util/logging';
import { WorkspaceManagerClientProvider } from "@gitpod/ws-manager/lib/client-provider";
import { WorkspaceManagerClientProviderSource } from "@gitpod/ws-manager/lib/client-provider-source";
import { log } from "@gitpod/gitpod-protocol/lib/util/logging";
import { TLSConfig, WorkspaceClusterDB, WorkspaceClusterWoTLS } from "@gitpod/gitpod-protocol/lib/workspace-cluster";
import { WorkspaceCluster } from "@gitpod/gitpod-protocol/lib/workspace-cluster";
import { Queue } from "@gitpod/gitpod-protocol";
import { defaultGRPCOptions } from '@gitpod/gitpod-protocol/lib/util/grpc';
import * as grpc from '@grpc/grpc-js';
import { defaultGRPCOptions } from "@gitpod/gitpod-protocol/lib/util/grpc";
import * as grpc from "@grpc/grpc-js";
import { PrometheusMetricsExporter } from "./prometheus-metrics-exporter";

@injectable()
Expand Down Expand Up @@ -45,7 +45,10 @@ export class BridgeController {
} catch (err) {
log.error("error reconciling WorkspaceCluster", err);
} finally {
this.reconcileTimer = setTimeout(scheduleReconcile, this.config.wsClusterDBReconcileIntervalSeconds * 1000);
this.reconcileTimer = setTimeout(
scheduleReconcile,
this.config.wsClusterDBReconcileIntervalSeconds * 1000,
);
}
};
await scheduleReconcile();
Expand Down Expand Up @@ -98,7 +101,7 @@ export class BridgeController {
};
const clientProvider = async () => {
return this.clientProvider.get(cluster.name, grpcOptions);
}
};
bridge.start(cluster, clientProvider);
return bridge;
}
Expand Down Expand Up @@ -133,15 +136,15 @@ export class WorkspaceManagerClientProviderConfigSource implements WorkspaceMana
protected readonly config: Configuration;

public async getWorkspaceCluster(name: string): Promise<WorkspaceCluster | undefined> {
return this.clusters.find(m => m.name === name);
return this.clusters.find((m) => m.name === name);
}

public async getAllWorkspaceClusters(): Promise<WorkspaceClusterWoTLS[]> {
return this.clusters;
}

protected get clusters(): WorkspaceCluster[] {
return this.config.staticBridges.map(c => {
return this.config.staticBridges.map((c) => {
if (!c.tls) {
return c;
}
Expand All @@ -152,8 +155,8 @@ export class WorkspaceManagerClientProviderConfigSource implements WorkspaceMana
ca: TLSConfig.loadFromBase64File(c.tls.ca),
crt: TLSConfig.loadFromBase64File(c.tls.crt),
key: TLSConfig.loadFromBase64File(c.tls.key),
}
}
},
};
});
}
}
}
Loading

0 comments on commit 9bec4a3

Please sign in to comment.