Hi Stephan,<br>
<br>
Is these code all right?<br>
<br>
Regards,<br>
Simon<br><br><div><span class="gmail_quote">On 11/13/05, <b class="gmail_sendername">Simon Hang</b> <<a href="mailto:hangzhiyun@gmail.com">hangzhiyun@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks Stephan,<br>
<br>
Here is the test:(test_ramcache.py)<br>
<br>
class TestStorage(TestCase):<br>
<br>
def test_getEntry(self):<br>
<br>
--snipped--<br>
<br>
def test_getEntry_do_cleanup(self):<br>
from zope.app.cache.ram import Storage<br>
<br>
s = Storage(cleanupInterval=300, maxAge=300)<br>
object = 'object'<br>
key = ('view', (), ('answer', 42))<br>
value = 'yes'<br>
<br>
s.setEntry(object, key, value)<br>
<br>
s._data[object][key][1] = time() - 400<br>
s.lastCleanup = time() - 400<br>
<br>
try:<br>
s.getEntry(object, key)<br>
except KeyError:<br>
pass<br>
else:<br>
raise "cleanup not called"<br>
<br>
def test_setEntry(self):<br> --snipped--<div><span class="e" id="q_10786f5d31a68ed2_1"><br>
<br>
<br><div><span class="gmail_quote">On 11/12/05, <b class="gmail_sendername">Stephan Richter</b> <<a href="mailto:srichter@cosmos.phy.tufts.edu" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">srichter@cosmos.phy.tufts.edu
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Tuesday 01 November 2005 05:10, Simon Hang wrote:<br>> Dear all,<br>><br>> I'm happen to find out call Storage only do cleanup when new Entry comes<br>> and do nothing when entries get from storage. So entries will be next
<br>> expired if there are only read activities.<br><br>I agree with your analysis and solution. If you provide a test for the fix,<br>I'll check it in. If you cannot write a test, please add least add an issue<br>to the issue collector.
<br><br>Regards,<br>Stephan<br>--<br>Stephan Richter<br>CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)<br>Web2k - Web Software Design, Development and Training<br></blockquote></div><br>
</span></div></blockquote></div><br>