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