Skip to content

Commit b6a74eb

Browse files
committed
fixbug
1 parent ce8e0d8 commit b6a74eb

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

cmd/server/app/command.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ func NewCommand() (cmd *cobra.Command) {
3232
RunEvent()
3333
var nodeCtx context.Context
3434
var err error
35-
if nodeCtx, err = RunNode(context.Background()); err != nil {
35+
ctx := context.Background()
36+
if nodeCtx, err = RunNode(ctx); err != nil {
3637
fmt.Println(err.Error())
3738
os.Exit(1)
3839
}
3940
event.Event(event2.NewInfoNode("Run node success"))
40-
if err = RunConsole(context.Background()); err != nil {
41+
if err = RunConsole(ctx); err != nil {
4142
fmt.Println(err.Error())
4243
os.Exit(1)
4344
}

cmd/server/app/console.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
// RunConsole run gin
10-
func RunConsole() (err error) {
11-
err = console.Run(context.Background())
10+
func RunConsole(c context.Context) (err error) {
11+
err = console.Run(c)
1212
return
1313
}

0 commit comments

Comments
 (0)