(self)
| 301 | |
| 302 | @functools.cached_property |
| 303 | def memcache(self): |
| 304 | if servers := config.get("memcache_servers", None): |
| 305 | return olmemcache.Client(servers) |
| 306 | else: |
| 307 | web.debug("Could not find memcache_servers in the configuration. Used dummy memcache.") |
| 308 | from pymemcache.test.utils import MockMemcacheClient |
| 309 | |
| 310 | return MockMemcacheClient() |
| 311 | |
| 312 | def _encode_key(self, key: str) -> str: |
| 313 | return cast(str, web.safestr(key)) |