Commit 780aa15b authored by Yoshinori Okuji's avatar Yoshinori Okuji

Increase the time when expiring.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@7 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 6ca87255
...@@ -201,6 +201,8 @@ class MQ: ...@@ -201,6 +201,8 @@ class MQ:
self._data[id] = data self._data[id] = data
self._size += len(value) # XXX inaccurate self._size += len(value) # XXX inaccurate
self._time += 1
# Expire old elements. # Expire old elements.
for level in range(self._buffer_levels): for level in range(self._buffer_levels):
cache_buffer = self._cache_buffers[level] cache_buffer = self._cache_buffers[level]
...@@ -257,4 +259,4 @@ if __name__ == '__main__': ...@@ -257,4 +259,4 @@ if __name__ == '__main__':
assert cache.get(2) == "2", 'cannot get 2' assert cache.get(2) == "2", 'cannot get 2'
assert cache.get(3) == None, 'can get 3!' assert cache.get(3) == None, 'can get 3!'
del cache[1] del cache[1]
assert cache.get(1) == None, 'can get 1!' assert cache.get(1) == None, 'can get 1!'
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment