Skip to content

Commit

Permalink
[bridge] Use PrebuildUpdater in MetaInstanceController when stopping …
Browse files Browse the repository at this point in the history
…workspace instances waiting for an imagebuild
  • Loading branch information
geropl committed Jun 2, 2022
1 parent ddd06f0 commit d9dea34
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/ws-manager-bridge/src/meta-instance-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Disposable, DisposableCollection, RunningWorkspaceInfo } from "@gitpod/
import { MessageBusIntegration } from "./messagebus-integration";
import { Configuration } from "./config";
import { repeat } from "@gitpod/gitpod-protocol/lib/util/repeat";
import { PrebuildUpdater } from "./prebuild-updater";

@injectable()
export class MetaInstanceController implements Disposable {
Expand All @@ -23,6 +24,9 @@ export class MetaInstanceController implements Disposable {
@inject(WorkspaceDB)
protected readonly workspaceDB: WorkspaceDB;

@inject(PrebuildUpdater)
protected readonly prebuildUpdater: PrebuildUpdater;

protected readonly disposables = new DisposableCollection();

protected async checkAndStopWorkspaces() {
Expand Down Expand Up @@ -77,6 +81,8 @@ export class MetaInstanceController implements Disposable {
instance.workspace.ownerId,
instance.latestInstance,
);

await this.prebuildUpdater.stopPrebuildInstance({}, instance.latestInstance);
}
} catch (err) {
log.warn(logContext, "MetaInstanceController: Error whilst stopping workspace instance", err);
Expand Down

0 comments on commit d9dea34

Please sign in to comment.