Skip to content

Commit

Permalink
bug: port repeat use when run test(#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjcsjc123 committed Jul 4, 2023
1 parent e663e3a commit dba1e6b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
39 changes: 39 additions & 0 deletions cmd/client/app.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package client

import "github.com/desertbit/grumble"

func Register(app *grumble.App) {
app.AddCommand(&grumble.Command{
Name: "put",
Help: "put data",
Run: putData,

Check failure on line 9 in cmd/client/app.go

View workflow job for this annotation

GitHub Actions / build (1.18)

undefined: putData

Check failure on line 9 in cmd/client/app.go

View workflow job for this annotation

GitHub Actions / build (1.19)

undefined: putData

Check failure on line 9 in cmd/client/app.go

View workflow job for this annotation

GitHub Actions / build (1.20)

undefined: putData
Args: func(a *grumble.Args) {
a.String("key", "key", grumble.Default(""))
a.String("value", "value", grumble.Default(""))
},
})

app.AddCommand(&grumble.Command{
Name: "get",
Help: "get data",
Run: getData,

Check failure on line 19 in cmd/client/app.go

View workflow job for this annotation

GitHub Actions / build (1.18)

undefined: getData

Check failure on line 19 in cmd/client/app.go

View workflow job for this annotation

GitHub Actions / build (1.19)

undefined: getData

Check failure on line 19 in cmd/client/app.go

View workflow job for this annotation

GitHub Actions / build (1.20)

undefined: getData
Args: func(a *grumble.Args) {
a.String("key", "key", grumble.Default(""))
},
})

app.AddCommand(&grumble.Command{
Name: "delete",
Help: "delete key",
Run: deleteKey,

Check failure on line 28 in cmd/client/app.go

View workflow job for this annotation

GitHub Actions / build (1.18)

undefined: deleteKey

Check failure on line 28 in cmd/client/app.go

View workflow job for this annotation

GitHub Actions / build (1.19)

undefined: deleteKey

Check failure on line 28 in cmd/client/app.go

View workflow job for this annotation

GitHub Actions / build (1.20)

undefined: deleteKey
Args: func(a *grumble.Args) {
a.String("key", "key", grumble.Default(""))
},
})

app.AddCommand(&grumble.Command{
Name: "keys",
Help: "list keys",
Run: getKeys,

Check failure on line 37 in cmd/client/app.go

View workflow job for this annotation

GitHub Actions / build (1.18)

undefined: getKeys

Check failure on line 37 in cmd/client/app.go

View workflow job for this annotation

GitHub Actions / build (1.19)

undefined: getKeys

Check failure on line 37 in cmd/client/app.go

View workflow job for this annotation

GitHub Actions / build (1.20)

undefined: getKeys
})
}
3 changes: 2 additions & 1 deletion engine/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,8 @@ func (db *DB) loadIndexFromDataFiles() error {
func (db *DB) startGrpcServer() {
listener, err := net.Listen("tcp", db.options.Addr)
if err != nil {
panic(err)
_ = fmt.Errorf("tcp listen error: %v", err)
return
}
server := grpc.NewServer()
grpc_health_v1.RegisterHealthServer(server, health.NewServer())
Expand Down

0 comments on commit dba1e6b

Please sign in to comment.