Skip to content

Commit

Permalink
debug-perf-3
Browse files Browse the repository at this point in the history
  • Loading branch information
wy65701436 committed May 20, 2024
1 parent be839e6 commit 1934c57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"flag"
"fmt"
"net/http"
_ "net/http/pprof"
"net/url"
"os"
"os/signal"
Expand Down Expand Up @@ -125,6 +126,9 @@ func gracefulShutdown(closing, done chan struct{}, shutdowns ...func()) {
}

func main() {
go func() {
log.Info(http.ListenAndServe("0.0.0.0:6060", nil))
}()
runMode := flag.String("mode", "normal", "The harbor-core container run mode, it could be normal, migrate or skip-migrate, default is normal")
flag.Parse()

Expand Down
6 changes: 6 additions & 0 deletions src/jobservice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import (
"errors"
"flag"
"fmt"
"github.com/goharbor/harbor/src/lib/log"
"net/http"
_ "net/http/pprof"

"github.com/goharbor/harbor/src/common"
"github.com/goharbor/harbor/src/jobservice/common/utils"
Expand All @@ -41,6 +44,9 @@ import (
)

func main() {
go func() {
log.Info(http.ListenAndServe("0.0.0.0:7070", nil))
}()
cfgLib.DefaultCfgManager = common.RestCfgManager
if err := cfgLib.DefaultMgr().Load(context.Background()); err != nil {
panic(fmt.Sprintf("failed to load configuration, error: %v", err))
Expand Down

0 comments on commit 1934c57

Please sign in to comment.