Skip to content

Commit 067ab1d

Browse files
committed
review feedback
Signed-off-by: Callum Styan <callumstyan@gmail.com>
1 parent 2fef481 commit 067ab1d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

coderd/agentapi/stats.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ func (a *StatsAPI) UpdateStats(ctx context.Context, req *agentproto.UpdateStatsR
4545
}
4646

4747
// Inject RBAC object into context for dbauthz fast path, avoid having to
48-
// call GetWorkspaceByAgentID on every metadata update.
49-
var err error
48+
// call GetWorkspaceAgentByID on every stats update.
49+
5050
rbacCtx := ctx
5151
if dbws, ok := a.Workspace.AsWorkspaceIdentity(); ok {
52+
var err error
5253
rbacCtx, err = dbauthz.WithWorkspaceRBAC(ctx, dbws.RBACObject())
5354
if err != nil {
5455
// Don't error level log here, will exit the function. We want to fall back to GetWorkspaceByAgentID.

0 commit comments

Comments
 (0)