(self, key, value, serialize=False)
| 123 | return retVal |
| 124 | |
| 125 | def write(self, key, value, serialize=False): |
| 126 | if key: |
| 127 | hash_ = HashDB.hashKey(key) |
| 128 | with self._cache_lock: |
| 129 | self._write_cache[hash_] = getUnicode(value) if not serialize else serializeObject(value) |
| 130 | cache_size = len(self._write_cache) |
| 131 | time_since_flush = time.time() - self._last_flush_time |
| 132 | |
| 133 | if cache_size >= HASHDB_FLUSH_THRESHOLD_ITEMS or time_since_flush >= HASHDB_FLUSH_THRESHOLD_TIME: |
| 134 | self.flush() |
| 135 | |
| 136 | def flush(self): |
| 137 | with self._cache_lock: |
nothing calls this directly
no test coverage detected