Skip to content

Commit

Permalink
Ease requirements for profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
iknite committed Apr 8, 2019
1 parent fd426ab commit 5a0b48e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ func NewRootCommand(args []string) *cobra.Command {
Short: "QED is a client for the verifiable log server",
// TraverseChildren: true,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if ctx.profiling {
go func() {
if err := http.ListenAndServe("127.0.0.1:6060", nil); err != http.ErrServerClosed {
log.Errorf("Can't start profiling HTTP server: %s", err)
}
}()

}
if ctx.configFile != "" {
v.SetConfigFile(ctx.configFile)
} else {
Expand Down Expand Up @@ -73,6 +65,16 @@ func NewRootCommand(args []string) *cobra.Command {

}

ctx.profiling = v.GetBool("profiling")
if ctx.profiling {
go func() {
if err := http.ListenAndServe("127.0.0.1:6060", nil); err != http.ErrServerClosed {
log.Errorf("Can't start profiling HTTP server: %s", err)
}
}()

}

markStringRequired(ctx.apiKey, "apikey")

},
Expand Down

0 comments on commit 5a0b48e

Please sign in to comment.