Skip to content

Commit

Permalink
Do not send initial queued prebuild phase from workspace starter (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptronicek authored Jun 26, 2024
1 parent aaa928c commit b06f861
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions components/server/src/workspace/workspace-starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,14 +628,6 @@ export class WorkspaceStarter {
},
timestamp: new Date(instance.creationTime),
});

// update prebuild status hook
if (workspace.type === "prebuild") {
// do not await
this.notifyOnPrebuildQueued(ctx, workspace.id).catch((err) => {
log.error("failed to notify on prebuild queued", err);
});
}
} catch (err) {
if (isGrpcError(err) && err.code === grpc.status.ALREADY_EXISTS) {
// This might happen because of timing: When we did the "workspaceAlreadyExists" check above, the DB state was not updated yet.
Expand Down Expand Up @@ -792,29 +784,6 @@ export class WorkspaceStarter {
return res;
}

private async notifyOnPrebuildQueued(ctx: TraceContext, workspaceId: string) {
const span = TraceContext.startSpan("notifyOnPrebuildQueued", ctx);
try {
const prebuild = await this.workspaceDb.trace({ span }).findPrebuildByWorkspaceID(workspaceId);
if (prebuild) {
const info = (await this.workspaceDb.trace({ span }).findPrebuildInfos([prebuild.id]))[0];
if (info) {
await this.publisher.publishPrebuildUpdate({
prebuildID: prebuild.id,
projectID: info.projectId,
status: "queued",
workspaceID: workspaceId,
});
}
}
} catch (e) {
TraceContext.setError({ span }, e);
throw e;
} finally {
span.finish();
}
}

/**
* failInstanceStart properly fails a workspace instance if something goes wrong before the instance ever reaches
* workspace manager. In this case we need to make sure we also fulfil the tasks of the bridge (e.g. for prebulds).
Expand Down

0 comments on commit b06f861

Please sign in to comment.