(self, key: Hashable)
| 106 | self._lock.release() |
| 107 | |
| 108 | def delete(self, key: Hashable) -> bool: |
| 109 | if not self._lock.acquire(blocking=True, timeout=LOCK_TIMEOUT): |
| 110 | raise Exception("DataCache.delete" + ERR_LOCK_FAILED) |
| 111 | try: |
| 112 | if key not in self._base: |
| 113 | return False |
| 114 | del self._base[key] |
| 115 | return True |
| 116 | finally: |
| 117 | self._lock.release() |
| 118 | |
| 119 | def keep(self, key: Hashable, ttl: int) -> bool: |
| 120 | if not self._lock.acquire(blocking=True, timeout=LOCK_TIMEOUT): |
no outgoing calls
no test coverage detected