Skip to content

Commit 7ca3fac

Browse files
committed
not cache empty results (...)
1 parent 2af504e commit 7ca3fac

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/redturtle/pasldap/resilient.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ def _wrapper(
5555

5656
if cache_key:
5757
logger.info("MISS: enumerateUsers %s", cache_key)
58+
if not users:
59+
# TODO: verificare se il risultato vuoto è un errore (da non mettere in cache) o veramente
60+
# un risultato vuoto (da mettere in cache? solo temporaneamente?)
61+
logger.warning(
62+
"enumerateUsers %s not found (possible error? not caching?)",
63+
cache_key,
64+
)
65+
return users
5866
if not hasattr(self, "_cache_users"):
5967
self._cache_users = PersistentMapping()
6068
safeWrite(self)

0 commit comments

Comments
 (0)