Skip to content

Commit

Permalink
Run pprof in a random port for builds
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed Jul 12, 2023
1 parent f4848fb commit 9975952
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ import (
"fmt"
"io"
"net/http"
_ "net/http/pprof"
"os"
"os/exec"
"path/filepath"
"runtime"
"time"

"github.com/gitpod-io/leeway/pkg/leeway"
"github.com/gookit/color"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/gitpod-io/leeway/pkg/leeway"
)

// buildCmd represents the build command
Expand All @@ -27,6 +29,11 @@ var buildCmd = &cobra.Command{
if pkg == nil {
log.Fatal("build needs a package")
}

go func() {
log.Println(http.ListenAndServe("localhost:0", nil))
}()

opts, localCache := getBuildOpts(cmd)

var (
Expand Down

0 comments on commit 9975952

Please sign in to comment.