fix(main): fix bug in startup when tracing is not present

This commit is contained in:
hannahhoward 2021-12-01 18:53:00 -08:00
parent f3b691d618
commit bfd1099ef3
2 changed files with 6 additions and 2 deletions

View File

@ -66,7 +66,9 @@ func main() {
cmd := cmd cmd := cmd
originBefore := cmd.Before originBefore := cmd.Before
cmd.Before = func(cctx *cli.Context) error { cmd.Before = func(cctx *cli.Context) error {
_ = jaeger.Shutdown(cctx.Context) if jaeger != nil {
_ = jaeger.Shutdown(cctx.Context)
}
jaeger = tracing.SetupJaegerTracing("lotus/" + cmd.Name) jaeger = tracing.SetupJaegerTracing("lotus/" + cmd.Name)
if cctx.IsSet("color") { if cctx.IsSet("color") {

View File

@ -47,7 +47,9 @@ func main() {
cmd := cmd cmd := cmd
originBefore := cmd.Before originBefore := cmd.Before
cmd.Before = func(cctx *cli.Context) error { cmd.Before = func(cctx *cli.Context) error {
_ = jaeger.Shutdown(cctx.Context) if jaeger != nil {
_ = jaeger.Shutdown(cctx.Context)
}
jaeger = tracing.SetupJaegerTracing("lotus/" + cmd.Name) jaeger = tracing.SetupJaegerTracing("lotus/" + cmd.Name)
if originBefore != nil { if originBefore != nil {