Skip to content

Commit

Permalink
Disable vote event postimport to avoid lots of vote event deletions
Browse files Browse the repository at this point in the history
  • Loading branch information
jessemortenson committed Mar 6, 2024
1 parent 4d8009f commit 646b4c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
logging.getLogger("s3transfer").setLevel(logging.WARNING)
logging.getLogger("urllib3.connectionpool").setLevel(logging.WARNING)


logger = logging.getLogger()
logger.setLevel(logging.INFO)

Expand Down Expand Up @@ -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}")

Expand Down

0 comments on commit 646b4c0

Please sign in to comment.