mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-02 19:55:18 +02:00
remove MCP health check branch from Notion metadata service
This commit is contained in:
parent
177a346673
commit
978a8e2e07
1 changed files with 0 additions and 21 deletions
|
|
@ -227,30 +227,9 @@ class NotionToolMetadataService:
|
||||||
async def _check_account_health(self, connector_id: int) -> bool:
|
async def _check_account_health(self, connector_id: int) -> bool:
|
||||||
"""Check if a Notion connector's token is still valid.
|
"""Check if a Notion connector's token is still valid.
|
||||||
|
|
||||||
For regular connectors: uses ``users.me()`` via the Notion SDK.
|
|
||||||
For MCP-mode connectors: uses ``notion-get-self`` via the MCP adapter.
|
|
||||||
|
|
||||||
Returns True if the token is expired/invalid, False if healthy.
|
Returns True if the token is expired/invalid, False if healthy.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
result = await self._db_session.execute(
|
|
||||||
select(SearchSourceConnector).filter(
|
|
||||||
SearchSourceConnector.id == connector_id
|
|
||||||
)
|
|
||||||
)
|
|
||||||
db_connector = result.scalars().first()
|
|
||||||
if not db_connector:
|
|
||||||
return True
|
|
||||||
|
|
||||||
if (db_connector.config or {}).get("mcp_mode"):
|
|
||||||
from app.services.notion_mcp.adapter import NotionMCPAdapter
|
|
||||||
|
|
||||||
adapter = NotionMCPAdapter(
|
|
||||||
session=self._db_session, connector_id=connector_id
|
|
||||||
)
|
|
||||||
health = await adapter.health_check()
|
|
||||||
return health.get("status") != "success"
|
|
||||||
|
|
||||||
connector = NotionHistoryConnector(
|
connector = NotionHistoryConnector(
|
||||||
session=self._db_session, connector_id=connector_id
|
session=self._db_session, connector_id=connector_id
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue