Skip to content

Commit 71d66af

Browse files
refactor: add minor comment
1 parent b0a025e commit 71d66af

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

coderd/workspaces.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,8 @@ func createWorkspace(
650650
if req.TemplateVersionPresetID != uuid.Nil {
651651
// Try and claim an eligible prebuild, if available.
652652
claimedWorkspace, err = claimPrebuild(ctx, prebuildsClaimer, db, api.Logger, req, owner)
653+
// If claiming fails with an expected error (no claimable prebuilds or AGPL does not support prebuilds),
654+
// we fall back to creating a new workspace. Otherwise, propagate the unexpected error.
653655
if err != nil &&
654656
!errors.Is(err, prebuilds.ErrNoClaimablePrebuiltWorkspaces) &&
655657
!errors.Is(err, prebuilds.ErrAGPLDoesNotSupportPrebuilds) {

0 commit comments

Comments
 (0)