Skip to content

Commit 69a0935

Browse files
geroplroboquat
authored andcommitted
[bridge] Cleanup dead code (probes workspaces are long-gone)
1 parent 8c2e1d1 commit 69a0935

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
@@ -380,8 +380,6 @@ export class WorkspaceManagerBridge implements Disposable {
380380

381381
// cleanup
382382
// important: call this after the DB update
383-
await this.cleanupProbeWorkspace(ctx, status);
384-
385383
if (!!lifecycleHandler) {
386384
await lifecycleHandler();
387385
}
@@ -469,10 +467,6 @@ export class WorkspaceManagerBridge implements Disposable {
469467
await Promise.all(promises);
470468
}
471469

472-
protected async cleanupProbeWorkspace(ctx: TraceContext, status: WorkspaceStatus.AsObject | undefined) {
473-
// probes are an EE feature - we just need the hook here
474-
}
475-
476470
protected async updatePrebuiltWorkspace(
477471
ctx: TraceContext,
478472
userId: string,

0 commit comments

Comments
 (0)