aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/index-genenetwork14
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/index-genenetwork b/scripts/index-genenetwork
index 4d9a5f8..61780e5 100755
--- a/scripts/index-genenetwork
+++ b/scripts/index-genenetwork
@@ -461,12 +461,14 @@ def is_data_modified(xapian_directory: str,
sparql_uri: str) -> None:
dir_ = pathlib.Path(xapian_directory)
with locked_xapian_writable_database(dir_) as db, database_connection(sql_uri) as conn:
- checksums = " ".join([
- str(result["Checksum"].value)
- for result in query_sql(
- conn,
- f"CHECKSUM TABLE {', '.join(db.get_metadata('tables').decode().split())}")
- ])
+ checksums = -1
+ if db.get_metadata('tables'):
+ checksums = " ".join([
+ str(result["Checksum"].value)
+ for result in query_sql(
+ conn,
+ f"CHECKSUM TABLE {', '.join(db.get_metadata('tables').decode().split())}")
+ ])
# Return a zero exit status code when the data has changed;
# otherwise exit with a 1 exit status code.
if (db.get_metadata("generif-checksum").decode() == hash_generif_graph(sparql_uri) and