diff --git a/scripts/generate.py b/scripts/generate.py index 2ca6882..e9bed85 100644 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -108,7 +108,13 @@ def load_all(top_dir_relative): def regen_all(src_top, dest_top, *, docs=None, db=None): files_generated = 0 cur = db.cursor() - cur.execute('DELETE FROM note_search;') + cleaned_db = False + + try: + cur.execute('DELETE FROM note_search;') + cleaned_db = True + except sqlite3.OperationalError as err: + logging.warn("Error pre-cleaning DB, search won't be updated") docs = load_all(src_top) doc_to_headline_remapping = {}