mirror of
https://github.com/django-components/django-components.git
synced 2025-08-08 08:17:59 +00:00
refactor: fix error when template cache is set to 0 (#980)
This commit is contained in:
parent
58d4c78671
commit
fdfdc72ed2
3 changed files with 31 additions and 0 deletions
|
@ -63,6 +63,10 @@ class LRUCache(Generic[T]):
|
|||
:param key: Key to insert or update.
|
||||
:param value: Value to associate with the key.
|
||||
"""
|
||||
# Noop if maxsize is set to 0
|
||||
if self.maxsize is not None and self.maxsize <= 0:
|
||||
return
|
||||
|
||||
if key in self.cache:
|
||||
node = self.cache[key]
|
||||
# Update the value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue