mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
@@ -555,6 +555,9 @@ func (api *API) workspaceAgentLogs(rw http.ResponseWriter, r *http.Request) {
|
||||
t := time.NewTicker(recheckInterval)
|
||||
defer t.Stop()
|
||||
|
||||
// Log the request immediately instead of after it completes.
|
||||
httpmw.RequestLoggerFromContext(ctx).WriteLog(ctx, http.StatusAccepted)
|
||||
|
||||
go func() {
|
||||
defer func() {
|
||||
logger.Debug(ctx, "end log streaming loop")
|
||||
@@ -928,6 +931,9 @@ func (api *API) derpMapUpdates(rw http.ResponseWriter, r *http.Request) {
|
||||
encoder := wsjson.NewEncoder[*tailcfg.DERPMap](ws, websocket.MessageBinary)
|
||||
defer encoder.Close(websocket.StatusGoingAway)
|
||||
|
||||
// Log the request immediately instead of after it completes.
|
||||
httpmw.RequestLoggerFromContext(ctx).WriteLog(ctx, http.StatusAccepted)
|
||||
|
||||
go func(ctx context.Context) {
|
||||
// TODO(mafredri): Is this too frequent? Use separate ping disconnect timeout?
|
||||
t := time.NewTicker(api.AgentConnectionUpdateFrequency)
|
||||
@@ -1315,6 +1321,9 @@ func (api *API) watchWorkspaceAgentMetadata(
|
||||
sendTicker := time.NewTicker(sendInterval)
|
||||
defer sendTicker.Stop()
|
||||
|
||||
// Log the request immediately instead of after it completes.
|
||||
httpmw.RequestLoggerFromContext(ctx).WriteLog(ctx, http.StatusAccepted)
|
||||
|
||||
// Send initial metadata.
|
||||
sendMetadata()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user