MCPcopy Create free account
hub / github.com/NanmiCoder/MediaCrawler / keys

Method keys

cache/local_cache.py:83–96  ·  view source on GitHub ↗

Get all keys matching the pattern :param pattern: Matching pattern :return:

(self, pattern: str)

Source from the content-addressed store, hash-verified

81 self._cache_container[key] = (value, time.time() + expire_time)
82
83 def keys(self, pattern: str) -> List[str]:
84 """
85 Get all keys matching the pattern
86 :param pattern: Matching pattern
87 :return:
88 """
89 if pattern == '*':
90 return list(self._cache_container.keys())
91
92 # For local cache wildcard, temporarily replace * with empty string
93 if '*' in pattern:
94 pattern = pattern.replace('*', '')
95
96 return [key for key in self._cache_container.keys() if pattern in key]
97
98 def _schedule_clear(self):
99 """

Callers 1

local_cache.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected