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

add IsBusyGroup() to rueidis.RedisError #485

Merged
merged 3 commits into from
Mar 1, 2024
Merged

add IsBusyGroup() to rueidis.RedisError #485

merged 3 commits into from
Mar 1, 2024

Conversation

jhq0113
Copy link
Contributor

@jhq0113 jhq0113 commented Mar 1, 2024

When executing the XGROUP CREATE <key> <group> <id> command, if group already exists, Redis will return BUSYGROUP..., Generally, the caller BUSYGROUP needs to distinguish from other errors, and adding this judgment can facilitate differentiation from other errors

Verified

This commit was signed with the committer’s verified signature. The key has expired.
infinisil Silvan Mosberger
@codecov-commenter
Copy link

codecov-commenter commented Mar 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.71%. Comparing base (ded6852) to head (c9e6d06).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #485      +/-   ##
==========================================
- Coverage   95.72%   95.71%   -0.01%     
==========================================
  Files          77       77              
  Lines       33084    33091       +7     
==========================================
+ Hits        31669    31673       +4     
- Misses       1210     1211       +1     
- Partials      205      207       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rueian
Copy link
Collaborator

rueian commented Mar 1, 2024

Cool! Thanks @jhq0113!

Would you like to also add a global helper IsRedisBusyGroup? I guess that could help further streamline the developer experience:

err := client.Do(context.Background(), client.B().XgroupCreate().Key("").Group("").Id("").Build()).Error()
if rueidis.IsRedisBusyGroup(err) {
	// ...
}

jianghaiqiang and others added 2 commits March 1, 2024 14:13

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@jhq0113
Copy link
Contributor Author

jhq0113 commented Mar 1, 2024

Yes, I do

@rueian rueian added the feature label Mar 1, 2024
@rueian rueian self-requested a review March 1, 2024 16:04
@rueian rueian merged commit 7ef4762 into redis:main Mar 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants