oslo.limit/releasenotes/notes/enforcer-limit-caching-fb59725aad88b039.yaml
melanie witt 43683f543e Add caching of limits in Enforcer
This adds caching of resource limits for an Enforcer in order to
improve performance when repeated limit checks are needed. The cache
lasts the lifetime of an Enforcer and is enabled by default. It can be
disabled by passing cache=False when instantiating an Enforcer.

One usage pattern for a caching Enforcer would be to create an Enforcer
per service request so that the caching lives only as long as the
request.

Change-Id: I8e43dceec76aecd2b2ae23a137e56519efe29777
2021-10-18 21:43:57 +00:00

8 lines
295 B
YAML

---
features:
- |
``Enforcer`` objects now cache limits by default for the lifetime of the
object to provide improved performance when multiple calls of ``enforce()``
are needed. This behavior is controlled by the boolean ``cache`` keyword
argument to the ``__init__`` method.