Browse Source

Update lru_cache.py

master
mengskysama 4 years ago
parent
commit
418cadb945
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      shadowsocks/lru_cache.py

+ 1
- 1
shadowsocks/lru_cache.py View File

@@ -88,12 +88,12 @@ class LRUCache(collections.MutableMapping):
self.close_callback(value)
self._closed_values.add(value)
for key in self._time_to_keys[least]:
self._last_visits.popleft()
if key in self._store:
if now - self._keys_to_last_time[key] > self.timeout:
del self._store[key]
del self._keys_to_last_time[key]
c += 1
self._last_visits.popleft()
del self._time_to_keys[least]
if c:
self._closed_values.clear()

Loading…
Cancel
Save