comparison roundup/backends/rdbms_common.py @ 6918:cb2ed1e8c852

Change method for settin indexer; have test_livetest for pg cleanup Add code to defer opening the indexer only if indexer is native-fts. See if this fixes the sqlite OperationalError. Also under python 2.7 (only), the db from test_livetracker when using postgres FTS didn't empty the db. This caused the following test_postgres.py test to fail. Why it only showed up on 2.7 and not any of the 3.x releases is a mystery.
author John Rouillard <rouilj@ieee.org>
date Tue, 06 Sep 2022 14:43:36 -0400
parents 9ff091537f43
children 98d72d4bb489
comparison
equal deleted inserted replaced
6917:fba76e0bba98 6918:cb2ed1e8c852
186 # We would like to use get_indexer() to return the real 186 # We would like to use get_indexer() to return the real
187 # indexer class. However indexer=native-fts for postgres 187 # indexer class. However indexer=native-fts for postgres
188 # requires a database connection (conn) to be defined when 188 # requires a database connection (conn) to be defined when
189 # calling get_indexer. The call to open_connection creates the 189 # calling get_indexer. The call to open_connection creates the
190 # conn but also creates the schema if it is missing. 190 # conn but also creates the schema if it is missing.
191 self.indexer = CommonIndexer(self) 191 if self.config['INDEXER'] != 'native-fts':
192 self.indexer = get_indexer(config, self)
193 else:
194 self.indexer = CommonIndexer(self)
192 self.security = security.Security(self) 195 self.security = security.Security(self)
193 196
194 # additional transaction support for external files and the like 197 # additional transaction support for external files and the like
195 self.transactions = [] 198 self.transactions = []
196 199
215 # open a connection to the database, creating the "conn" attribute 218 # open a connection to the database, creating the "conn" attribute
216 self.open_connection() 219 self.open_connection()
217 220
218 # If indexer is native-fts, conn to db must be available. 221 # If indexer is native-fts, conn to db must be available.
219 # so we set the real self.indexer value here, after db is open. 222 # so we set the real self.indexer value here, after db is open.
220 self.indexer = get_indexer(config, self) 223 if self.config['INDEXER'] == 'native-fts':
224 self.indexer = get_indexer(config, self)
221 225
222 def clearCache(self): 226 def clearCache(self):
223 self.cache = {} 227 self.cache = {}
224 self.cache_lru = [] 228 self.cache_lru = []
225 # upcall is necessary! 229 # upcall is necessary!

Roundup Issue Tracker: http://roundup-tracker.org/