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;') cur.execute('DELETE FROM note_search;')
cleaned_db = True cleaned_db = True
except sqlite3.OperationalError as err: except sqlite3.OperationalError as err:
if WATCH:
logging.warning("Error pre-cleaning DB, search won't be updated") logging.warning("Error pre-cleaning DB, search won't be updated")
else:
raise
docs = load_all(src_top) docs = load_all(src_top)
doc_to_headline_remapping = {} doc_to_headline_remapping = {}