You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One benefit of the group= kwarg I identified in #48 is that it acts as a natural key to use to define at least default values for the decorator elsewhere, i.e.: settings. E.g.:
The setting would override the defaults but could be overridden by the call site, so the precedence is:
call site (either @ratelimit decorator or is_ratelimited helper)
RATELIMIT_GROUPS setting
ratelimit's defaults.
It makes it much, much easier to do a few things:
Update a shared ratelimit everywhere
Confidently use a shared ratelimit in multiple contexts
Temporarily disable ratelimits with fewer touch points
The way counters are constructed, overriding any of the values in the decorator would cause the group= to count separately—but that's true now, so it's probably something that just needs better documentation.
The text was updated successfully, but these errors were encountered:
One benefit of the
group=
kwarg I identified in #48 is that it acts as a natural key to use to define at least default values for the decorator elsewhere, i.e.: settings. E.g.:The setting would override the defaults but could be overridden by the call site, so the precedence is:
@ratelimit
decorator oris_ratelimited
helper)RATELIMIT_GROUPS
settingIt makes it much, much easier to do a few things:
The way counters are constructed, overriding any of the values in the decorator would cause the
group=
to count separately—but that's true now, so it's probably something that just needs better documentation.The text was updated successfully, but these errors were encountered: