Skip to content

Commit 8625b65

Browse files
committed
[bridge] Cleanup dead code (probes workspaces are long-gone)
1 parent 92e2e72 commit 8625b65

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

components/ws-manager-bridge/ee/src/bridge.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { WorkspaceManagerBridge } from "../../src/bridge";
88
import { inject, injectable } from "inversify";
99
import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing";
10-
import { WorkspaceStatus, WorkspaceType, WorkspacePhase } from "@gitpod/ws-manager/lib";
10+
import { WorkspaceStatus, WorkspaceType } from "@gitpod/ws-manager/lib";
1111
import { HeadlessWorkspaceEvent } from "@gitpod/gitpod-protocol/lib/headless-workspace-log";
1212
import { WorkspaceInstance } from "@gitpod/gitpod-protocol";
1313
import { log, LogContext } from "@gitpod/gitpod-protocol/lib/util/logging";
@@ -18,29 +18,6 @@ export class WorkspaceManagerBridgeEE extends WorkspaceManagerBridge {
1818
@inject(PrebuildStateMapper)
1919
protected readonly prebuildStateMapper: PrebuildStateMapper;
2020

21-
protected async cleanupProbeWorkspace(ctx: TraceContext, status: WorkspaceStatus.AsObject | undefined) {
22-
if (!status) {
23-
return;
24-
}
25-
if (status.spec && status.spec.type != WorkspaceType.PROBE) {
26-
return;
27-
}
28-
if (status.phase !== WorkspacePhase.STOPPED) {
29-
return;
30-
}
31-
32-
const span = TraceContext.startSpan("cleanupProbeWorkspace", ctx);
33-
try {
34-
const workspaceId = status.metadata!.metaId!;
35-
await this.workspaceDB.trace({ span }).hardDeleteWorkspace(workspaceId);
36-
} catch (e) {
37-
TraceContext.setError({ span }, e);
38-
throw e;
39-
} finally {
40-
span.finish();
41-
}
42-
}
43-
4421
protected async updatePrebuiltWorkspace(
4522
ctx: TraceContext,
4623
userId: string,

components/ws-manager-bridge/src/bridge.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,6 @@ export class WorkspaceManagerBridge implements Disposable {
384384

385385
// cleanup
386386
// important: call this after the DB update
387-
await this.cleanupProbeWorkspace(ctx, status);
388-
389387
if (!!lifecycleHandler) {
390388
await lifecycleHandler();
391389
}
@@ -473,10 +471,6 @@ export class WorkspaceManagerBridge implements Disposable {
473471
await Promise.all(promises);
474472
}
475473

476-
protected async cleanupProbeWorkspace(ctx: TraceContext, status: WorkspaceStatus.AsObject | undefined) {
477-
// probes are an EE feature - we just need the hook here
478-
}
479-
480474
protected async updatePrebuiltWorkspace(
481475
ctx: TraceContext,
482476
userId: string,

0 commit comments

Comments
 (0)