From b6a74eb9ed55bf6066e8b14ca3d3b5011fd22518 Mon Sep 17 00:00:00 2001 From: Caesar Date: Tue, 14 Dec 2021 14:38:46 +0800 Subject: [PATCH] fixbug --- cmd/server/app/command.go | 5 +++-- cmd/server/app/console.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/server/app/command.go b/cmd/server/app/command.go index e99caf0c..8c4bea63 100644 --- a/cmd/server/app/command.go +++ b/cmd/server/app/command.go @@ -32,12 +32,13 @@ func NewCommand() (cmd *cobra.Command) { RunEvent() var nodeCtx context.Context var err error - if nodeCtx, err = RunNode(context.Background()); err != nil { + ctx := context.Background() + if nodeCtx, err = RunNode(ctx); err != nil { fmt.Println(err.Error()) os.Exit(1) } event.Event(event2.NewInfoNode("Run node success")) - if err = RunConsole(context.Background()); err != nil { + if err = RunConsole(ctx); err != nil { fmt.Println(err.Error()) os.Exit(1) } diff --git a/cmd/server/app/console.go b/cmd/server/app/console.go index f66665af..57e6a388 100644 --- a/cmd/server/app/console.go +++ b/cmd/server/app/console.go @@ -7,7 +7,7 @@ import ( ) // RunConsole run gin -func RunConsole() (err error) { - err = console.Run(context.Background()) +func RunConsole(c context.Context) (err error) { + err = console.Run(c) return }