Commit f1f04e44 authored by Hanno Schlichting's avatar Hanno Schlichting

Less generic name

parent 87fe1a95
...@@ -17,7 +17,7 @@ from thread import allocate_lock ...@@ -17,7 +17,7 @@ from thread import allocate_lock
from Products.PluginIndexes.interfaces import IUniqueValueIndex from Products.PluginIndexes.interfaces import IUniqueValueIndex
writelock = allocate_lock() reportlock = allocate_lock()
reports = {} reports = {}
MAX_DISTINCT_VALUES = 10 MAX_DISTINCT_VALUES = 10
...@@ -149,7 +149,7 @@ class CatalogReport(StopWatch): ...@@ -149,7 +149,7 @@ class CatalogReport(StopWatch):
if res[0] < self.threshold: if res[0] < self.threshold:
return return
writelock.acquire() reportlock.acquire()
try: try:
if not reports.has_key(self.cid): if not reports.has_key(self.cid):
reports[self.cid] = {} reports[self.cid] = {}
...@@ -163,15 +163,15 @@ class CatalogReport(StopWatch): ...@@ -163,15 +163,15 @@ class CatalogReport(StopWatch):
reports[self.cid][key] = (1,res[0],res) reports[self.cid][key] = (1,res[0],res)
finally: finally:
writelock.release() reportlock.release()
def reset(self): def reset(self):
writelock.acquire() reportlock.acquire()
try: try:
reports[self.cid] = {} reports[self.cid] = {}
finally: finally:
writelock.release() reportlock.release()
def report(self): def report(self):
......
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