mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
fix: Fix err check in DialWorkspaceAgentTailnet (#4320)
This commit is contained in:
committed by
GitHub
parent
78a39a809d
commit
00d0620679
@ -331,8 +331,12 @@ func (c *Client) DialWorkspaceAgentTailnet(ctx context.Context, logger slog.Logg
|
|||||||
// Need to disable compression to avoid a data-race.
|
// Need to disable compression to avoid a data-race.
|
||||||
CompressionMode: websocket.CompressionDisabled,
|
CompressionMode: websocket.CompressionDisabled,
|
||||||
})
|
})
|
||||||
if errors.Is(err, context.Canceled) {
|
if err != nil {
|
||||||
return
|
if errors.Is(err, context.Canceled) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Debug(ctx, "failed to dial", slog.Error(err))
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
if isFirst {
|
if isFirst {
|
||||||
if res.StatusCode == http.StatusConflict {
|
if res.StatusCode == http.StatusConflict {
|
||||||
@ -342,14 +346,6 @@ func (c *Client) DialWorkspaceAgentTailnet(ctx context.Context, logger slog.Logg
|
|||||||
isFirst = false
|
isFirst = false
|
||||||
close(first)
|
close(first)
|
||||||
}
|
}
|
||||||
if err != nil {
|
|
||||||
logger.Debug(ctx, "failed to dial", slog.Error(err))
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if isFirst {
|
|
||||||
isFirst = false
|
|
||||||
close(first)
|
|
||||||
}
|
|
||||||
sendNode, errChan := tailnet.ServeCoordinator(websocket.NetConn(ctx, ws, websocket.MessageBinary), func(node []*tailnet.Node) error {
|
sendNode, errChan := tailnet.ServeCoordinator(websocket.NetConn(ctx, ws, websocket.MessageBinary), func(node []*tailnet.Node) error {
|
||||||
return conn.UpdateNodes(node)
|
return conn.UpdateNodes(node)
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user