Skip to content
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

fix: redis's pipeline logs are not printed completely #2538

Merged
merged 2 commits into from Oct 22, 2022

Conversation

pig-peppa
Copy link
Contributor

in AfterProcessPipeline function,"logDuration(ctx, cmds[0], duration)" will print pipeline's first command

Copy link
Contributor

@kevwan kevwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add unit tests to cover the newly added code.

Signed-off-by: liaoshiwei <liaoshiwei@uniontech.com>
@pig-peppa
Copy link
Contributor Author

Unit test has been added

}
build.WriteString(mapping.Repr(arg))
}
buf.WriteString(mapping.Repr(build.String()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already string, no need to use mapping.Repr?

logDuration(context.Background(), []red.Cmder{red.NewCmd(context.Background(), "get", "foo")}, 1*time.Second)
assert.True(t, strings.Contains(w.String(), "get foo"))

logDuration(context.Background(), []red.Cmder{red.NewCmd(context.Background(), "get", "foo"), red.NewCmd(context.Background(), "set", "bar", 0)}, 1*time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line is too long.

@kevwan kevwan merged commit b21162d into zeromicro:master Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants