Mercurial > p > roundup > code
diff 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 |
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py Tue Sep 06 11:32:13 2022 -0400 +++ b/roundup/backends/rdbms_common.py Tue Sep 06 14:43:36 2022 -0400 @@ -188,7 +188,10 @@ # requires a database connection (conn) to be defined when # calling get_indexer. The call to open_connection creates the # conn but also creates the schema if it is missing. - self.indexer = CommonIndexer(self) + if self.config['INDEXER'] != 'native-fts': + self.indexer = get_indexer(config, self) + else: + self.indexer = CommonIndexer(self) self.security = security.Security(self) # additional transaction support for external files and the like @@ -217,7 +220,8 @@ # If indexer is native-fts, conn to db must be available. # so we set the real self.indexer value here, after db is open. - self.indexer = get_indexer(config, self) + if self.config['INDEXER'] == 'native-fts': + self.indexer = get_indexer(config, self) def clearCache(self): self.cache = {}
