X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/197870e67a82505d52fb2fd45db638435af956b0..25557e5f14734aa597dbe32293be25d2c539531c:/test/bdd/steps/nominatim_environment.py diff --git a/test/bdd/steps/nominatim_environment.py b/test/bdd/steps/nominatim_environment.py index 2547bbe2..7013a20e 100644 --- a/test/bdd/steps/nominatim_environment.py +++ b/test/bdd/steps/nominatim_environment.py @@ -191,6 +191,20 @@ class NominatimEnvironment: if not self.keep_scenario_db: self.db_drop_database(self.test_db) + def reindex_placex(self, db): + """ Run the indexing step until all data in the placex has + been processed. Indexing during updates can produce more data + to index under some circumstances. That is why indexing may have + to be run multiple times. + """ + with db.cursor() as cur: + while True: + self.run_update_script('index') + + cur.execute("SELECT 'a' FROM placex WHERE indexed_status != 0 LIMIT 1") + if cur.rowcount == 0: + return + def run_setup_script(self, *args, **kwargs): """ Run the Nominatim setup script with the given arguments. """