fix(state): guard the duplicate-title repair so it can never abort DB open
Follow-up to the salvaged #65636: if the dedup UPDATE or the retried CREATE INDEX raises, log and continue — the unique title index is an optimization and must not block SessionDB initialization.fix/verification-admin-route-recovery
parent
3990bdf551
commit
9fc8fe2176
|
|
@ -1787,6 +1787,9 @@ class SessionDB:
|
|||
try:
|
||||
cursor.execute(title_index_sql)
|
||||
except sqlite3.IntegrityError:
|
||||
# The index is an optimization — its creation must never abort
|
||||
# opening the database, so the repair itself is also guarded.
|
||||
try:
|
||||
cursor.execute(
|
||||
"""UPDATE sessions AS older
|
||||
SET title = NULL
|
||||
|
|
@ -1802,6 +1805,11 @@ class SessionDB:
|
|||
cursor.rowcount,
|
||||
)
|
||||
cursor.execute(title_index_sql)
|
||||
except sqlite3.Error:
|
||||
logger.exception(
|
||||
"Could not repair duplicate session titles; "
|
||||
"unique title index not created"
|
||||
)
|
||||
except sqlite3.OperationalError:
|
||||
pass # Index already exists
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue