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:
self._data[id] = data
self._size += len(value) # XXX inaccurate
self._time += 1
# Expire old elements.
for level in range(self._buffer_levels):
cache_buffer = self._cache_buffers[level]
......@@ -257,4 +259,4 @@ if __name__ == '__main__':
assert cache.get(2) == "2", 'cannot get 2'
assert cache.get(3) == None, 'can get 3!'
del cache[1]
assert cache.get(1) == None, 'can get 1!'
\ No newline at end of file
assert cache.get(1) == None, 'can get 1!'
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