Check if key exists in cache
(self, key: str)
| 101 | return False |
| 102 | |
| 103 | async def exists(self, key: str) -> bool: |
| 104 | """Check if key exists in cache""" |
| 105 | if not self._connected: |
| 106 | return False |
| 107 | try: |
| 108 | return await self._client.exists(key) > 0 |
| 109 | except Exception as e: |
| 110 | logger.error(f"Cache exists error: {e}") |
| 111 | return False |
| 112 | |
| 113 | async def incr_with_ttl(self, key: str, ttl: int) -> Optional[int]: |
| 114 | """ |