-
-
Notifications
You must be signed in to change notification settings - Fork 633
ratelimits: Refactor Reset() to accept a batch of Transactions #8503
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: main
Are you sure you want to change the base?
Conversation
c9297b0 to
f4ec6cd
Compare
|
I am satisfied that all keys will be deleted even if some are missing. |
| func (r *RedisSource) Delete(ctx context.Context, bucketKey string) error { | ||
| // BatchDelete deletes the TATs at the specified bucketKeys ('name:id'). A nil | ||
| // return value does not indicate that the bucketKeys existed. | ||
| func (r *RedisSource) BatchDelete(ctx context.Context, bucketKeys []string) error { |
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't BatchDelete and Delete just be a single function with variadic args?
func (r *RedisSource) Delete(ctx context.Context, bucketKeys ...string) error {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.
Actually, I’m just going to remove Delete(). I had a caller for it originally, but I removed that and forgot to drop the implementation. As for switching from []string to a variadic, it doesn’t feel consistent unless BatchGet() changes too, and modifying the Source interface that much doesn’t seem worthwhile unless there’s a compelling reason I’m missing??
Fixes #8305