New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
services: redis: add command data payloads #348
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #348 +/- ##
=========================================
Coverage ? 43.52%
=========================================
Files ? 71
Lines ? 8344
Branches ? 0
=========================================
Hits ? 3632
Misses ? 4296
Partials ? 416 Continue to review full report at Codecov.
|
services/redis/redis.go
Outdated
@@ -50,6 +51,8 @@ var ( | |||
_ = services.Register("redis", REDIS) | |||
) | |||
|
|||
var p [][]byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a shared buffer between all connections will cause issues.
services/redis/redis.go
Outdated
@@ -50,6 +51,8 @@ var ( | |||
_ = services.Register("redis", REDIS) | |||
) | |||
|
|||
var p [][]byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a shared buffer between connections will cause issues
services/redis/redis.go
Outdated
@@ -98,6 +101,7 @@ func (d *redisDatum) ToString() (value string, success bool) { | |||
func parseRedisData(scanner *bufio.Scanner) (redisDatum, error) { | |||
scanner.Scan() | |||
cmd := scanner.Text() | |||
p = append(p, []byte(cmd+"\r\n")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just append to []byte instead of [][]byte
Fixes #329