Skip to content

Commit cd70514

Browse files
committed
system call
1 parent ca851ba commit cd70514

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

coderd/workspacestats/reporter.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414

1515
agentproto "github.com/coder/coder/v2/agent/proto"
1616
"github.com/coder/coder/v2/coderd/database"
17+
"github.com/coder/coder/v2/coderd/database/dbauthz"
1718
"github.com/coder/coder/v2/coderd/database/dbtime"
1819
"github.com/coder/coder/v2/coderd/database/pubsub"
1920
"github.com/coder/coder/v2/coderd/prometheusmetrics"
@@ -175,7 +176,8 @@ func (r *Reporter) ReportAgentStats(ctx context.Context, now time.Time, workspac
175176
ConnectionMedianLatencyMS: []float64{stats.ConnectionMedianLatencyMs},
176177
}
177178
elapsed := time.Since(start)
178-
err = r.opts.Database.InsertWorkspaceAgentStats(ctx, params)
179+
// nolint: gocritic // system function
180+
err = r.opts.Database.InsertWorkspaceAgentStats(dbauthz.AsSystemRestricted(ctx), params)
179181
if err != nil {
180182
if database.IsQueryCanceledError(err) {
181183
r.opts.Logger.Debug(ctx, "query canceled, skipping insert of workspace agent stats", slog.F("elapsed", elapsed))

0 commit comments

Comments
 (0)