Skip to content

Commit

Permalink
Check for principal DB connection before starting raw export script
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaris committed Dec 12, 2023
1 parent 84e6a41 commit 28265da
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/indra_cogex/sources/indra_db/raw_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ def get_update(start_date):
if not os.environ.get("INDRA_DB_LITE_LOCATION"):
raise ValueError("Environment variable 'INDRA_DB_LITE_LOCATION' not set")

# This checks that a connection to the prinicipal db is needed for the
# preassembly step as fallback when the indra_db_lite is missing content
from indra_db import get_db
db = get_db("primary")
if db is None:
raise ValueError("Could not connect to the principal db")

# This checks if there are any adeft models available. They are needed to
if len(get_available_models()) == 0:
raise ValueError(
Expand Down

0 comments on commit 28265da

Please sign in to comment.