Skip to content

Conversation

@beautifulentropy
Copy link
Member

Fixes #8305

@beautifulentropy beautifulentropy force-pushed the make-resets-take-transactions branch from c9297b0 to f4ec6cd Compare November 21, 2025 17:40
@beautifulentropy beautifulentropy changed the title ratelimits: Refactor Reset() to accept Transactions ratelimits: Refactor Reset() to accept a batch of Transactions Nov 21, 2025
@beautifulentropy beautifulentropy marked this pull request as ready for review November 21, 2025 17:47
@beautifulentropy beautifulentropy requested a review from a team as a code owner November 21, 2025 17:47
@beautifulentropy beautifulentropy marked this pull request as draft November 21, 2025 18:08
@beautifulentropy beautifulentropy marked this pull request as ready for review November 21, 2025 18:49
@beautifulentropy
Copy link
Member Author

I am satisfied that all keys will be deleted even if some are missing. Ring.Del(ctx, keys...) builds one DEL per shard, grouping keys by hash slot. Each shard runs a DEL with only its keys. Non-existent keys are ignored, per Redis docs.

jprenken
jprenken previously approved these changes Nov 21, 2025
@jprenken jprenken requested a review from aarongable November 21, 2025 22:58
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 {
Copy link
Contributor

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 {

Copy link
Member Author

@beautifulentropy beautifulentropy Nov 24, 2025

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??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ratelimits: Make ratelimits.NewRegIdIdentValueBucketKey private

4 participants