Skip to content

Commit acd5868

Browse files
committed
feat: add app status tracking to the backend
1 parent 7b14b4f commit acd5868

File tree

2 files changed

+46
-55
lines changed

2 files changed

+46
-55
lines changed

coderd/apidoc/docs.go

Lines changed: 39 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/workspaces.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,6 +1988,13 @@ func (api *API) workspaceData(ctx context.Context, workspaces []database.Workspa
19881988
return workspaceData{}, err
19891989
}
19901990

1991+
// This query must be run as system restricted to be efficient.
1992+
// nolint:gocritic
1993+
appStatuses, err := api.Database.GetLatestWorkspaceAppStatusesByWorkspaceIDs(dbauthz.AsSystemRestricted(ctx), workspaceIDs)
1994+
if err != nil && !errors.Is(err, sql.ErrNoRows) {
1995+
return workspaceData{}, xerrors.Errorf("get workspace app statuses: %w", err)
1996+
}
1997+
19911998
data, err := api.workspaceBuildsData(ctx, builds)
19921999
if err != nil {
19932000
return workspaceData{}, xerrors.Errorf("get workspace builds data: %w", err)

0 commit comments

Comments
 (0)