fix: fix indentation and add try/finally in digest startup
This commit is contained in:
parent
b56ad40c9e
commit
7d9be91aab
2 changed files with 16 additions and 14 deletions
|
|
@ -57,6 +57,7 @@ def _strip_html(text: str | None) -> str | None:
|
|||
def _startup():
|
||||
"""Ensure digest_queue table exists (dev-api may run against an existing DB)."""
|
||||
db = _get_db()
|
||||
try:
|
||||
db.execute("""
|
||||
CREATE TABLE IF NOT EXISTS digest_queue (
|
||||
id INTEGER PRIMARY KEY,
|
||||
|
|
@ -66,6 +67,7 @@ def _startup():
|
|||
)
|
||||
""")
|
||||
db.commit()
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue