Skip to content

Commit

Permalink
fix(main): fix bug in startup when tracing is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahhoward committed Dec 2, 2021
1 parent f3b691d commit bfd1099
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/lotus-miner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ func main() {
cmd := cmd
originBefore := cmd.Before
cmd.Before = func(cctx *cli.Context) error {
_ = jaeger.Shutdown(cctx.Context)
if jaeger != nil {
_ = jaeger.Shutdown(cctx.Context)
}
jaeger = tracing.SetupJaegerTracing("lotus/" + cmd.Name)

if cctx.IsSet("color") {
Expand Down
4 changes: 3 additions & 1 deletion cmd/lotus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ func main() {
cmd := cmd
originBefore := cmd.Before
cmd.Before = func(cctx *cli.Context) error {
_ = jaeger.Shutdown(cctx.Context)
if jaeger != nil {
_ = jaeger.Shutdown(cctx.Context)
}
jaeger = tracing.SetupJaegerTracing("lotus/" + cmd.Name)

if originBefore != nil {
Expand Down

0 comments on commit bfd1099

Please sign in to comment.