[Zope3-dev] (zope/app/cache/ram.py) class Storage's cleanup problem.

Simon Hang hangzhiyun at gmail.com
Tue Nov 1 05:10:07 EST 2005


Dear all,

I'm happen to find out call Storage only do cleanup when new Entry comes and
do nothing when entries get from storage. So entries will be next expired if
there are only read activities.

So I suggest we may change the getEntry as below:

def getEntry(self, ob, key):
# start of insert
if self.lastCleanup <= time() - self.cleanupInterval:
self.cleanup()
# end of insert
try:
data = self._data[ob][key]
except KeyError:
if ob not in self._misses:
self._misses[ob] = 0
self._misses[ob] += 1
raise
else:
data[2] += 1 # increment access count
return data[0]

Can somebody update this into the repository?

Thanks,
Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-dev/attachments/20051101/951b9489/attachment.htm


More information about the Zope3-dev mailing list