From 646b4c095b1cf73742943b3082d1037319a061fe Mon Sep 17 00:00:00 2001 From: Jesse Mortenson Date: Wed, 6 Mar 2024 00:38:07 -0600 Subject: [PATCH] Disable vote event postimport to avoid lots of vote event deletions --- app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 0fc53ca..ef041c0 100644 --- a/app.py +++ b/app.py @@ -13,7 +13,6 @@ logging.getLogger("s3transfer").setLevel(logging.WARNING) logging.getLogger("urllib3.connectionpool").setLevel(logging.WARNING) - logger = logging.getLogger() logger.setLevel(logging.INFO) @@ -289,8 +288,11 @@ def do_import(jurisdiction_id: str, datadir: str) -> None: # datadir = os.path.join(settings.SCRAPED_DATA_DIR, state) juris_importer = JurisdictionImporter(jurisdiction_id) + # bills postimport disabled because bill postimport does some expensive SQL, and we want this to be fast bill_importer = BillImporter(jurisdiction_id, do_postimport=False) - vote_event_importer = VoteEventImporter(jurisdiction_id, bill_importer) + # votes postimport disabled because it will delete all vote events for the related bill + # except the vote event being processed now, causing votes to be deleted and re-created + vote_event_importer = VoteEventImporter(jurisdiction_id, bill_importer, do_postimport=False) event_importer = EventImporter(jurisdiction_id, vote_event_importer) logger.info(f"Datadir: {datadir}")