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

Commitfa64c58

Browse files
authored
chore: Export all functions used by server cmd (#7118)
* chore: Export all functions used by server cmdRequired to make workspace proxy cmd* Factor out httpservers and tracer
1 parent87fe16c commitfa64c58

File tree

3 files changed

+242
-192
lines changed

3 files changed

+242
-192
lines changed

‎cli/agent.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
8888
ctx,stopNotify:=signal.NotifyContext(ctx,InterruptSignals...)
8989
deferstopNotify()
9090

91-
//dumpHandler does signal handling, so we call it after the
91+
//DumpHandler does signal handling, so we call it after the
9292
// reaper.
93-
godumpHandler(ctx)
93+
goDumpHandler(ctx)
9494

9595
ljLogger:=&lumberjack.Logger{
9696
Filename:filepath.Join(logDir,"coder-agent.log"),
@@ -119,7 +119,7 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
119119
// Enable pprof handler
120120
// This prevents the pprof import from being accidentally deleted.
121121
_=pprof.Handler
122-
pprofSrvClose:=serveHandler(ctx,logger,nil,pprofAddress,"pprof")
122+
pprofSrvClose:=ServeHandler(ctx,logger,nil,pprofAddress,"pprof")
123123
deferpprofSrvClose()
124124
// Do a best effort here. If this fails, it's not a big deal.
125125
ifport,err:=urlPort(pprofAddress);err==nil {
@@ -262,7 +262,7 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
262262
returncmd
263263
}
264264

265-
funcserveHandler(ctx context.Context,logger slog.Logger,handler http.Handler,addr,namestring) (closeFuncfunc()) {
265+
funcServeHandler(ctx context.Context,logger slog.Logger,handler http.Handler,addr,namestring) (closeFuncfunc()) {
266266
logger.Debug(ctx,"http server listening",slog.F("addr",addr),slog.F("name",name))
267267

268268
// ReadHeaderTimeout is purposefully not enabled. It caused some issues with

‎cli/root.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ func (h *headerTransport) RoundTrip(req *http.Request) (*http.Response, error) {
711711
returnh.transport.RoundTrip(req)
712712
}
713713

714-
//dumpHandler provides a custom SIGQUIT and SIGTRAP handler that dumps the
714+
//DumpHandler provides a custom SIGQUIT and SIGTRAP handler that dumps the
715715
// stacktrace of all goroutines to stderr and a well-known file in the home
716716
// directory. This is useful for debugging deadlock issues that may occur in
717717
// production in workspaces, since the default Go runtime will only dump to
@@ -723,7 +723,7 @@ func (h *headerTransport) RoundTrip(req *http.Request) (*http.Response, error) {
723723
// A SIGQUIT handler will not be registered if GOTRACEBACK=crash.
724724
//
725725
// On Windows this immediately returns.
726-
funcdumpHandler(ctx context.Context) {
726+
funcDumpHandler(ctx context.Context) {
727727
ifruntime.GOOS=="windows" {
728728
// free up the goroutine since it'll be permanently blocked anyways
729729
return

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp