-
Notifications
You must be signed in to change notification settings - Fork 948
change check order for xautoclaim #2318
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: unstable
Are you sure you want to change the base?
Conversation
Signed-off-by: charsyam <[email protected]>
Signed-off-by: charsyam <[email protected]>
128bc26
to
2a82deb
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #2318 +/- ##
============================================
- Coverage 71.44% 71.43% -0.02%
============================================
Files 123 123
Lines 67086 67086
============================================
- Hits 47931 47922 -9
- Misses 19155 19164 +9
🚀 New features to boost your workflow:
|
if (o == NULL) { | ||
addReplyErrorFormat(c, "-NOGROUP No such key '%s'", (char *)c->argv[1]->ptr); | ||
return; | ||
} |
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.
I'm not sure this is the correct error message. If I understand correctly, -NOGROUP
typically means the consumer group doesn't exist for the key, not that the key itself is missing. In this case, the error seems more related to the key not existing at all, so maybe a different error message would be more appropriate.
/* No key or group? Send an error given that the group creation | ||
* is mandatory. */ |
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.
We can change comment if it is necessary
if (group == NULL) { | ||
addReplyErrorFormat(c, "-NOGROUP No consumer group '%s'", (char *)c->argv[2]->ptr); |
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.
Can I know why the group null check is still needed here, now that the key existence check has been moved earlier? I'm also wondering if there is a specific reason to keep the group check separate.
change check order for xautocommit parameters
I think it is more readable and eailer.
because we already checked object is existed by lookupKeyRead at the beginning of code.
and it is a little bit faster when key is not exist.