diff --git a/cmd/lotus-miner/main.go b/cmd/lotus-miner/main.go index 497a9e9fb..57b5d8a3e 100644 --- a/cmd/lotus-miner/main.go +++ b/cmd/lotus-miner/main.go @@ -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") { diff --git a/cmd/lotus/main.go b/cmd/lotus/main.go index ddd695e68..c19b9fce4 100644 --- a/cmd/lotus/main.go +++ b/cmd/lotus/main.go @@ -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 {