From bfd1099ef3ff724bd1f68db591438f07953d9a80 Mon Sep 17 00:00:00 2001 From: hannahhoward Date: Wed, 1 Dec 2021 18:53:00 -0800 Subject: [PATCH] fix(main): fix bug in startup when tracing is not present --- cmd/lotus-miner/main.go | 4 +++- cmd/lotus/main.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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 {