Skip to content

Commit 299d30c

Browse files
committed
Fix race condition
1 parent aaefcaf commit 299d30c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coderd/workspaceagents.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ func (api *API) workspaceAgentCoordinate(rw http.ResponseWriter, r *http.Request
352352
closeChan := make(chan struct{})
353353
go func() {
354354
defer close(closeChan)
355-
err = api.TailnetCoordinator.ServeAgent(wsNetConn, workspaceAgent.ID)
355+
err := api.TailnetCoordinator.ServeAgent(wsNetConn, workspaceAgent.ID)
356356
if err != nil {
357357
_ = conn.Close(websocket.StatusInternalError, err.Error())
358358
return
@@ -375,7 +375,7 @@ func (api *API) workspaceAgentCoordinate(rw http.ResponseWriter, r *http.Request
375375
_ = conn.Close(websocket.StatusAbnormalClosure, err.Error())
376376
return
377377
}
378-
err = ensureLatestBuild()
378+
err := ensureLatestBuild()
379379
if err != nil {
380380
// Disconnect agents that are no longer valid.
381381
_ = conn.Close(websocket.StatusGoingAway, "")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy