mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-11 01:50:46 +08:00
fix: harden assistant SQLite/PostgreSQL dual-backend (singleton, timeouts, warnings)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
1490bd5f24
commit
1caf96e694
8 changed files with 129 additions and 15 deletions
|
|
@ -325,7 +325,16 @@ class SqliteStore:
|
|||
self.db_path = str(db_path)
|
||||
self._postgres_url = ""
|
||||
self._use_pg = False
|
||||
self._init_db()
|
||||
try:
|
||||
self._init_db()
|
||||
except Exception as exc:
|
||||
if self._use_pg:
|
||||
raise RuntimeError(
|
||||
"Assistant PostgreSQL initialization failed (connection, permissions, or missing tables). "
|
||||
"Apply schema with `alembic upgrade head` (or `svc/persistence/ddl/postgresql_bootstrap.sql`), "
|
||||
"verify AIA_ASSISTANT_DATABASE_URL, and inspect the chained exception."
|
||||
) from exc
|
||||
raise
|
||||
|
||||
@contextmanager
|
||||
def _connect(self) -> Iterator[Any]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue