Commit a27633eb authored by Jim Fulton's avatar Jim Fulton

Fixed bugs in caching logic.

parent ae57f7b0
......@@ -11,8 +11,8 @@
__doc__='''Generic Database adapter
$Id: DA.py,v 1.29 1998/01/27 18:37:39 jim Exp $'''
__version__='$Revision: 1.29 $'[11:-2]
$Id: DA.py,v 1.30 1998/01/27 20:08:19 jim Exp $'''
__version__='$Revision: 1.30 $'[11:-2]
import OFS.SimpleItem, Aqueduct.Aqueduct, Aqueduct.RDB
import DocumentTemplate, marshal, md5, base64, DateTime, Acquisition, os
......@@ -105,6 +105,7 @@ class DA(
self._setKey(key)
self.max_rows_ = max_rows
self.max_cache_, self.cache_time_ = max_cache, cache_time
self._v_cache={}
self.class_name_, self.class_file_ = class_name, class_file
getBrain(self)
if REQUEST: return self.manage_editedDialog(REQUEST)
......@@ -175,7 +176,7 @@ class DA(
result=apply(DB__.query, query)
r=compress(result)
cache[query]= now, r
if self.cache_time_ > 0: cache[query]= now, r
if compressed: return r
return result
......@@ -336,6 +337,9 @@ def getBrain(self,
##############################################################################
#
# $Log: DA.py,v $
# Revision 1.30 1998/01/27 20:08:19 jim
# Fixed bugs in caching logic.
#
# Revision 1.29 1998/01/27 18:37:39 jim
# Changed the way that errors are reported.
#
......
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