Treat DB cleanup as error when not in interactive mode.

This commit is contained in:
Sergio Martínez Portela 2022-11-15 21:11:58 +01:00
parent 9a883d90dd
commit 058f0caf73

View File

@ -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 = {}