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

Commit88d49db

Browse files
authored
fix: Add isFirst check before err check (#4326)
This was causing TestBlockNonBrowser to hang and fail.
1 parentc7aea2f commit88d49db

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎codersdk/workspaceagents.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -331,21 +331,21 @@ func (c *Client) DialWorkspaceAgentTailnet(ctx context.Context, logger slog.Logg
331331
// Need to disable compression to avoid a data-race.
332332
CompressionMode:websocket.CompressionDisabled,
333333
})
334-
iferr!=nil {
335-
iferrors.Is(err,context.Canceled) {
336-
return
337-
}
338-
logger.Debug(ctx,"failed to dial",slog.Error(err))
339-
continue
340-
}
341334
ifisFirst {
342-
ifres.StatusCode==http.StatusConflict {
335+
iferr!=nil&&res.StatusCode==http.StatusConflict {
343336
first<-readBodyAsError(res)
344337
return
345338
}
346339
isFirst=false
347340
close(first)
348341
}
342+
iferr!=nil {
343+
iferrors.Is(err,context.Canceled) {
344+
return
345+
}
346+
logger.Debug(ctx,"failed to dial",slog.Error(err))
347+
continue
348+
}
349349
sendNode,errChan:=tailnet.ServeCoordinator(websocket.NetConn(ctx,ws,websocket.MessageBinary),func(node []*tailnet.Node)error {
350350
returnconn.UpdateNodes(node)
351351
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp