Skip to content
Merged
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
Next Next commit
fix(coderd): check if timings can be read
  • Loading branch information
BrunoQuaresma committed Sep 17, 2024
commit f2eb0723daa854baf70bb9619099403723bc8caa
4 changes: 4 additions & 0 deletions coderd/database/dbauthz/dbauthz.go
Original file line number Diff line number Diff line change
Expand Up @@ -1792,6 +1792,10 @@ func (q *querier) GetProvisionerJobByID(ctx context.Context, id uuid.UUID) (data
}

func (q *querier) GetProvisionerJobTimingsByJobID(ctx context.Context, jobID uuid.UUID) ([]database.ProvisionerJobTiming, error) {
_, err := q.GetProvisionerJobByID(ctx, jobID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach raised my eyebrow, and I was going to suggest not doing it this way but I see we have precedent for this in GetProvisionerJobByID itself. Please add a comment explaining this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure we use a similar pattern for workspace builds or templates.

if err != nil {
return nil, err
}
return q.db.GetProvisionerJobTimingsByJobID(ctx, jobID)
}

Expand Down
Loading