fix(main): fix bug in startup when tracing is not present
This commit is contained in:
parent
f3b691d618
commit
bfd1099ef3
@ -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") {
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user