fix(lint): resolve remaining ruff errors and unblock MCP SSE test (#1)
Some checks failed
CI / lint (push) Failing after 2s
CI / typecheck (push) Failing after 1s
CI / test (push) Failing after 1s
CI / Secret scan (gitleaks) (push) Failing after 2s
CI / Security audit (bandit) (push) Failing after 2s

This commit is contained in:
Crypto Rug Munch 2026-07-02 23:18:40 +02:00
parent a7c30b12cd
commit 98eebe62bf
17 changed files with 60 additions and 87 deletions

5
db.py
View file

@ -84,6 +84,7 @@ try:
event,
)
from sqlalchemy.engine import Engine
from sqlalchemy.exc import OperationalError, ProgrammingError, SQLAlchemyError
from sqlalchemy.orm import DeclarativeBase, Session, sessionmaker
_HAS_SA = True
@ -691,7 +692,7 @@ def db_health() -> dict[str, Any]:
try:
result = conn.exec_driver_sql("SELECT sqlite_version()").fetchone()
sqlite_version = result[0] if result else None
except Exception:
except (OperationalError, ProgrammingError):
sqlite_version = None
return {
"available": True,
@ -700,5 +701,5 @@ def db_health() -> dict[str, Any]:
else _resolve_database_url(),
"sqlite_version": sqlite_version,
}
except Exception as e:
except SQLAlchemyError as e:
return {"available": False, "error": str(e)[:200]}