8000 renamed context fetcher · coder/coder@a772430 · GitHub
[go: up one dir, main page]

Skip to content

Commit a772430

Browse files
committed
renamed context fetcher
1 parent b7822b3 commit a772430

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

coderd/httpmw/logger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (c *RequestLoggerContext) WriteLog(ctx context.Context, status int) {
112112

113113
type logContextKey struct{}
114114

115-
func FromContext(ctx context.Context) *RequestLoggerContext {
115+
func RequestLoggerFromContext(ctx context.Context) *RequestLoggerContext {
116116
val := ctx.Value(logContextKey{})
117117
if logCtx, ok := val.(*RequestLoggerContext); ok {
118118
return logCtx

coderd/inboxnotifications.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func (api *API) watchInboxNotifications(rw http.ResponseWriter, r *http.Request)
220220
defer encoder.Close(websocket.StatusNormalClosure)
221221

222222
// Log the request immediately instead of after it completes.
223-
httpmw.FromContext(ctx).WriteLog(ctx, http.StatusAccepted)
223+
httpmw.RequestLoggerFromContext(ctx).WriteLog(ctx, http.StatusAccepted)
224224

225225
for {
226226
select {

coderd/provisionerjobs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ func (f *logFollower) follow() {
555555
}
556556

557557
// Log the request immediately instead of after it completes.
558-
httpmw.FromContext(f.ctx).WriteLog(f.ctx, http.StatusAccepted)
558+
httpmw.RequestLoggerFromContext(f.ctx).WriteLog(f.ctx, http.StatusAccepted)
559559

560560
// no need to wait if the job is done
561561
if f.complete {

coderd/workspaceagents.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ func (api *API) workspaceAgentLogs(rw http.ResponseWriter, r *http.Request) {
556556
defer t.Stop()
557557

558558
// Log the request immediately instead of after it completes.
559-
httpmw.FromContext(ctx).WriteLog(ctx, http.StatusAccepted)
559+
httpmw.RequestLoggerFromContext(ctx).WriteLog(ctx, http.StatusAccepted)
560560

561561
go func() {
562562
defer func() {
@@ -932,7 +932,7 @@ func (api *API) derpMapUpdates(rw http.ResponseWriter, r *http.Request) {
932932
defer encoder.Close(websocket.StatusGoingAway)
933933

934934
// Log the request immediately instead of after it completes.
935-
httpmw.FromContext(ctx).WriteLog(ctx, http.StatusAccepted)
935+
httpmw.RequestLoggerFromContext(ctx).WriteLog(ctx, http.StatusAccepted)
936936

937937
go func(ctx context.Context) {
938938
// TODO(mafredri): Is this too frequent? Use separate ping disconnect timeout?
@@ -1322,7 +1322,7 @@ func (api *API) watchWorkspaceAgentMetadata(
13221322
defer sendTicker.Stop()
13231323

13241324
// Log the request immediately instead of after it completes.
1325-
httpmw.FromContext(ctx).WriteLog(ctx, http.StatusAccepted)
1325+
httpmw.RequestLoggerFromContext(ctx).WriteLog(ctx, http.StatusAccepted)
13261326

13271327
// Send initial metadata.
13281328
sendMetadata()

enterprise/coderd/provisionerdaemons.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ func (api *API) provisionerDaemonServe(rw http.ResponseWriter, r *http.Request)
378378
})
379379

380380
// Log the request immediately instead of after it completes.
381-
httpmw.FromContext(ctx).WriteLog(ctx, http.StatusAccepted)
381+
httpmw.RequestLoggerFromContext(ctx).WriteLog(ctx, http.StatusAccepted)
382382

383383
err = server.Serve(ctx, session)
384384
srvCancel()

0 commit comments

Comments
 (0)
0