From 7d47c9e6508b875417fea79b90e302d448e7167c Mon Sep 17 00:00:00 2001 From: Gero Posmyk-Leinemann Date: Mon, 15 Aug 2022 14:24:32 +0000 Subject: [PATCH] [server] Mark instances whose image build failed as "stopped" --- components/server/src/workspace/workspace-starter.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/server/src/workspace/workspace-starter.ts b/components/server/src/workspace/workspace-starter.ts index 7984001102d64e..be37c4e74e46ef 100644 --- a/components/server/src/workspace/workspace-starter.ts +++ b/components/server/src/workspace/workspace-starter.ts @@ -1226,8 +1226,12 @@ export class WorkspaceStarter { message = err.message; } + // This instance's image build "failed" as well, so mark it as such. + const now = new Date().toISOString(); instance = await this.workspaceDb.trace({ span }).updateInstancePartial(instance.id, { - status: { ...instance.status, phase: "building", conditions: { failed: message }, message }, + status: { ...instance.status, phase: "stopped", conditions: { failed: message }, message }, + stoppedTime: now, + stoppingTime: now, }); await this.messageBus.notifyOnInstanceUpdate(workspace.ownerId, instance);