fix: fix indentation and add try/finally in digest startup

This commit is contained in:
pyr0ball 2026-03-20 02:36:23 -07:00
parent b56ad40c9e
commit 7d9be91aab
2 changed files with 16 additions and 14 deletions

View file

@ -57,6 +57,7 @@ def _strip_html(text: str | None) -> str | None:
def _startup(): def _startup():
"""Ensure digest_queue table exists (dev-api may run against an existing DB).""" """Ensure digest_queue table exists (dev-api may run against an existing DB)."""
db = _get_db() db = _get_db()
try:
db.execute(""" db.execute("""
CREATE TABLE IF NOT EXISTS digest_queue ( CREATE TABLE IF NOT EXISTS digest_queue (
id INTEGER PRIMARY KEY, id INTEGER PRIMARY KEY,
@ -66,6 +67,7 @@ def _startup():
) )
""") """)
db.commit() db.commit()
finally:
db.close() db.close()