Skip to content

add IsBusyGroup() to rueidis.RedisError#485

Merged
rueian merged 3 commits intoredis:mainfrom
jhq0113:main
Mar 1, 2024
Merged

add IsBusyGroup() to rueidis.RedisError#485
rueian merged 3 commits intoredis:mainfrom
jhq0113:main

Conversation

@jhq0113
Copy link
Copy Markdown
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

@codecov-commenter
Copy link
Copy Markdown

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
Copy Markdown
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) {
	// ...
}

@jhq0113
Copy link
Copy Markdown
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
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.

3 participants