varnish / varnish-modules

Collection of Varnish Cache modules (vmods) by Varnish Software
Other
185 stars 86 forks source link

Add vsthrottle.remove_bucket() #205

Closed sumit-kushwah closed 1 year ago

sumit-kushwah commented 1 year ago

VOID remove_bucket(STRING key, INT limit, DURATION period, DURATION block)

Arguments:

Description

Remove the token bucket identified by the four parameters, if it exists.

Example:

 sub vcl_deliver {
    vsthrottle.remove_bucket(client.identity, 15, 10s, 30s);
 }

it fixes the issue #204

sumit-kushwah commented 1 year ago

Ok, @gquintard Thanks for reviewing, I will make the changes as you suggested and write test cases.

sumit-kushwah commented 1 year ago

Hi, @gquintard I have made the changes you recommended and wrote test cases for the new remove_bucket function. Please let me know if there are any remaining issues that need to be addressed, or if there are any other areas of concern.

gquintard commented 1 year ago

great, looks good on my side, I'll pull in the others to see what they have to say.

hl @nigoroll, @hermunn, @Dridi

daghf commented 1 year ago

I'm good with this. @sumit-kushwah could you rebase and squash everything into a single commit?

sumit-kushwah commented 1 year ago

@daghf, Done.

daghf commented 1 year ago

Thanks a lot for the contribution, @sumit-kushwah

sumit-kushwah commented 1 year ago

@gquintard, @daghf Thank you for taking the time to review and merge my pull request. I really appreciate it!