mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
feat: implement cache invalidation for MCP connectors upon deletion in search source connectors
This commit is contained in:
parent
26695b949e
commit
3f68962772
1 changed files with 7 additions and 0 deletions
|
|
@ -636,9 +636,16 @@ async def delete_search_source_connector(
|
|||
)
|
||||
|
||||
# Delete the connector record
|
||||
search_space_id = db_connector.search_space_id
|
||||
is_mcp = db_connector.connector_type == SearchSourceConnectorType.MCP_CONNECTOR
|
||||
await session.delete(db_connector)
|
||||
await session.commit()
|
||||
|
||||
if is_mcp:
|
||||
from app.agents.new_chat.tools.mcp_tool import invalidate_mcp_tools_cache
|
||||
|
||||
invalidate_mcp_tools_cache(search_space_id)
|
||||
|
||||
logger.info(
|
||||
f"Connector {connector_id} ({connector_name}) deleted successfully. "
|
||||
f"Total documents deleted: {total_deleted}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue