Skip to content

Commit 98a7740

Browse files
committed
Fix going away
1 parent 9c4de6e commit 98a7740

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

enterprise/wsproxy/wsproxy.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,12 @@ func New(ctx context.Context, opts *Options) (*Server, error) {
250250

251251
func (s *Server) Close() error {
252252
s.cancel()
253-
go func() {
254-
// Do this in a go routine to not block the close. This is allowed
255-
// to fail, it is just a courtesy to the dashboard.
256-
_ = s.SDKClient.WorkspaceProxyGoingAway(context.Background())
257-
}()
253+
254+
// A timeout to prevent the SDK from blocking the server shutdown.
255+
tmp, cancel := context.WithTimeout(context.Background(), 3*time.Second)
256+
defer cancel()
257+
_ = s.SDKClient.WorkspaceProxyGoingAway(tmp)
258+
258259
return s.AppServer.Close()
259260
}
260261

site/src/api/typesGenerated.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,12 +1485,12 @@ export const ProvisionerTypes: ProvisionerType[] = ["echo", "terraform"]
14851485

14861486
// From codersdk/workspaceproxy.go
14871487
export type ProxyHealthStatus =
1488-
| "reachable"
1488+
| "ok"
14891489
| "unhealthy"
14901490
| "unreachable"
14911491
| "unregistered"
14921492
export const ProxyHealthStatuses: ProxyHealthStatus[] = [
1493-
"reachable",
1493+
"ok",
14941494
"unhealthy",
14951495
"unreachable",
14961496
"unregistered",

0 commit comments

Comments
 (0)