Changeset 1764 in products
- Timestamp:
- Feb 17, 2010 8:08:50 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.catalogupdater/trunk/quintagroup/catalogupdater/utility.py
r1755 r1764 1 1 import logging, types 2 import transaction 2 3 from zope.interface import implements 3 4 from zope.component import queryMultiAdapter … … 72 73 schema = _catalog.schema 73 74 paths = _catalog.paths 75 # For subtransaction support 76 threshold = getattr(catalog, 'threshold', 10000) 77 _v_total = 0 78 _v_transaction = None 74 79 75 80 # For each catalog record update metadata … … 97 102 data[rid] = tuple(mdlist) 98 103 104 # Steeled from ZCatalog 105 if threshold is not None: 106 # figure out whether or not to commit a subtransaction. 107 t = id(transaction.get()) 108 if t != _v_transaction: 109 _v_total = 0 110 _v_transaction = t 111 _v_total = _v_total + 1 112 if _v_total > threshold: 113 transaction.savepoint(optimistic=True) 114 catalog._p_jar.cacheGC() 115 _v_total = 0 116 LOG.info('commiting subtransaction') 117
Note: See TracChangeset
for help on using the changeset viewer.