Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
nits
  • Loading branch information
johnstcn committed Jun 20, 2025
commit 92a4b991c0da20d123a5b01c5b5db9263c4f68a6
1 change: 1 addition & 0 deletions coderd/database/dbmem/dbmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -4464,6 +4464,7 @@ func (q *FakeQuerier) GetProvisionerDaemons(_ context.Context) ([]database.Provi
defer q.mutex.RUnlock()

if len(q.provisionerDaemons) == 0 {
// Returning err=nil here for consistency with real querier
return []database.ProvisionerDaemon{}, nil
}
// copy the data so that the caller can't manipulate any data inside dbmem
Expand Down
8 changes: 4 additions & 4 deletions coderd/workspacebuilds.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,10 @@ func (api *API) postWorkspaceBuilds(rw http.ResponseWriter, r *http.Request) {
return
}

var qpr database.GetProvisionerJobsByIDsWithQueuePositionRow
var queuePos database.GetProvisionerJobsByIDsWithQueuePositionRow
if provisionerJob != nil {
qpr.ProvisionerJob = *provisionerJob
qpr.QueuePosition = 0
queuePos.ProvisionerJob = *provisionerJob
queuePos.QueuePosition = 0
if err := provisionerjobs.PostJob(api.Pubsub, *provisionerJob); err != nil {
// Client probably doesn't care about this error, so just log it.
api.Logger.Error(ctx, "failed to post provisioner job to pubsub", slog.Error(err))
Expand Down Expand Up @@ -468,7 +468,7 @@ func (api *API) postWorkspaceBuilds(rw http.ResponseWriter, r *http.Request) {
apiBuild, err := api.convertWorkspaceBuild(
*workspaceBuild,
workspace,
qpr,
queuePos,
[]database.WorkspaceResource{},
[]database.WorkspaceResourceMetadatum{},
[]database.WorkspaceAgent{},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const WorkspaceDeleteDialog: FC<WorkspaceDeleteDialogProps> = ({
// usually means that builds are failing as well.
// b) No provisioner is available to delete the workspace, which will
// cause the job to remain in the "pending" state indefinitely.
// The assumption here is that and admin will cancel the job.
// The assumption here is that an admin will cancel the job.
const canOrphan =
canDeleteFailedWorkspace &&
(workspace.latest_build.status === "failed" ||
Expand Down
Loading