-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix(redis): Implement redisNode interface for redis.Redis #5188
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Pull Request Overview
This PR implements the missing Pipeline
, TxPipelined
, and Command
methods on the redis.Redis
type to ensure it fully satisfies the redisNode
interface, addressing issue #5175.
Key changes:
- Added three new methods (
Pipeline
,TxPipelined
,Command
) to the Redis struct - Added a new type alias
CommandsInfoCmd
for the redis command info result - Updated and expanded test coverage for the new pipeline and command functionality
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
core/stores/redis/redis.go | Implements the three missing interface methods and adds CommandsInfoCmd type alias |
core/stores/redis/redis_test.go | Replaces old TxPipeline test with comprehensive tests for all three new methods including error cases |
} | ||
|
||
// Command is the implementation of redis command command. | ||
func (s *Redis) Command(ctx context.Context) *CommandsInfoCmd { |
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.
Is there any scenario that we need to run command
in services?
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.
Is there any scenario that we need to run
command
in services?
Maybe we don't have a specific use case for this method, it was added to fully implement the required interface.
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.
What if we remove this method?
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.
What if we remove this method?
then Redis doesn't fully implement the RedisNode interface, methods like Blpop , BlpopCtx , and BlpopEx cannot accept Redis as parameters.
This change implements the missing Pipeline , TxPipelined , and Command methods on the redis.Redis type. This ensures that *redis.Redis satisfies the redisNode interface.
close #5175