diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1931848..9f30b17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI on: push: - branches: [ main ] + branches: [ main, yevhenii/proxy-fixes ] pull_request: branches: [ main ] diff --git a/cmd/boundary/main.go b/cmd/boundary/main.go index 86eefa3..b12a991 100644 --- a/cmd/boundary/main.go +++ b/cmd/boundary/main.go @@ -2,11 +2,34 @@ package main import ( "fmt" + "log" "os" "github.com/coder/boundary/cli" ) +import ( + "net/http" + _ "net/http/pprof" +) + +func init() { + go func() { + //time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) + log.Println("Going to listen on 6060 or 6061") + + if err := http.ListenAndServe("0.0.0.0:6060", nil); err != nil { + if err := http.ListenAndServe("0.0.0.0:6061", nil); err != nil { + log.Println("pprof failed to start on both ports:", err) + return + } + log.Println("pprof listening on :6061") + return + } + log.Println("pprof listening on :6060") + }() +} + // Version information injected at build time var ( //nolint:unused