Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitef16802

Browse files
committed
added handling of internal test circumventing RequestLoggerContext injection path
1 parent28a11a6 commitef16802

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

‎coderd/inboxnotifications.go

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

222222
// Log the request immediately instead of after it completes.
223-
httpmw.RequestLoggerFromContext(ctx).WriteLog(ctx,http.StatusAccepted)
223+
requestLogger:=httpmw.RequestLoggerFromContext(ctx)
224+
ifrequestLogger!=nil {
225+
requestLogger.WriteLog(ctx,http.StatusAccepted)
226+
}
224227

225228
for {
226229
select {

‎coderd/provisionerjobs.go

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

557557
// Log the request immediately instead of after it completes.
558-
httpmw.RequestLoggerFromContext(f.ctx).WriteLog(f.ctx,http.StatusAccepted)
558+
requestLogger:=httpmw.RequestLoggerFromContext(f.ctx)
559+
ifrequestLogger!=nil {
560+
requestLogger.WriteLog(f.ctx,http.StatusAccepted)
561+
}
559562

560563
// no need to wait if the job is done
561564
iff.complete {

‎coderd/workspaceagents.go

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

558558
// Log the request immediately instead of after it completes.
559-
httpmw.RequestLoggerFromContext(ctx).WriteLog(ctx,http.StatusAccepted)
559+
requestLogger:=httpmw.RequestLoggerFromContext(ctx)
560+
ifrequestLogger!=nil {
561+
requestLogger.WriteLog(ctx,http.StatusAccepted)
562+
}
560563

561564
gofunc() {
562565
deferfunc() {
@@ -932,7 +935,10 @@ func (api *API) derpMapUpdates(rw http.ResponseWriter, r *http.Request) {
932935
deferencoder.Close(websocket.StatusGoingAway)
933936

934937
// Log the request immediately instead of after it completes.
935-
httpmw.RequestLoggerFromContext(ctx).WriteLog(ctx,http.StatusAccepted)
938+
requestLogger:=httpmw.RequestLoggerFromContext(ctx)
939+
ifrequestLogger!=nil {
940+
requestLogger.WriteLog(ctx,http.StatusAccepted)
941+
}
936942

937943
gofunc(ctx context.Context) {
938944
// TODO(mafredri): Is this too frequent? Use separate ping disconnect timeout?
@@ -1322,7 +1328,10 @@ func (api *API) watchWorkspaceAgentMetadata(
13221328
defersendTicker.Stop()
13231329

13241330
// Log the request immediately instead of after it completes.
1325-
httpmw.RequestLoggerFromContext(ctx).WriteLog(ctx,http.StatusAccepted)
1331+
requestLogger:=httpmw.RequestLoggerFromContext(ctx)
1332+
ifrequestLogger!=nil {
1333+
requestLogger.WriteLog(ctx,http.StatusAccepted)
1334+
}
13261335

13271336
// Send initial metadata.
13281337
sendMetadata()

‎enterprise/coderd/provisionerdaemons.go

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

380380
// Log the request immediately instead of after it completes.
381-
httpmw.RequestLoggerFromContext(ctx).WriteLog(ctx,http.StatusAccepted)
381+
requestLogger:=httpmw.RequestLoggerFromContext(ctx)
382+
ifrequestLogger!=nil {
383+
requestLogger.WriteLog(ctx,http.StatusAccepted)
384+
}
382385

383386
err=server.Serve(ctx,session)
384387
srvCancel()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp