(20251125) Minor RegEx search fix in the new caching system.

This commit is contained in:
2025-11-25 17:34:54 +05:30
parent 0dcbeb3ea3
commit d4dfeaa65b
+3 -2
View File
@@ -154,7 +154,7 @@ class AsyncLocalCache(AsyncCachingBase):
async def list_keys( async def list_keys(
self, self,
match: str = ".*", match: str | None = None,
raise_exception: bool = False raise_exception: bool = False
) -> List[str] | None: ) -> List[str] | None:
@@ -176,7 +176,8 @@ class AsyncLocalCache(AsyncCachingBase):
# Enlist all the keys, # Enlist all the keys,
# test the pattern against all the keys and keep only those that match: # test the pattern against all the keys and keep only those that match:
for k in self.__cached_data.keys(): for k in self.__cached_data.keys():
if regex.match(text = str(k), pattern = match): if match is None: keys_list.append(k)
elif regex.match(text = str(k), pattern = match):
keys_list.append(k) keys_list.append(k)
# Done here: # Done here: