From 058f0caf736b89e8206380722d2774cb80e9c61b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Tue, 15 Nov 2022 21:11:58 +0100 Subject: [PATCH] Treat DB cleanup as error when not in interactive mode. --- scripts/generate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/generate.py b/scripts/generate.py index 8bf0f3d..24f586f 100644 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -119,7 +119,10 @@ def regen_all(src_top, dest_top, *, docs=None, db=None): cur.execute('DELETE FROM note_search;') cleaned_db = True except sqlite3.OperationalError as err: - logging.warning("Error pre-cleaning DB, search won't be updated") + if WATCH: + logging.warning("Error pre-cleaning DB, search won't be updated") + else: + raise docs = load_all(src_top) doc_to_headline_remapping = {}