mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-10-21 09:32:24 +00:00
🔌 fix: Prevent Repeated Idle Check Triggers for Users With Failed MCP Connections (#12853)
This commit is contained in:
parent
2503365c44
commit
1f37ec842a
1 changed files with 8 additions and 2 deletions
|
|
@ -268,10 +268,16 @@ export abstract class UserConnectionManager {
|
|||
this.pendingConnections.delete(key);
|
||||
}
|
||||
}
|
||||
// Ensure user activity timestamp is removed
|
||||
this.userLastActivity.delete(userId);
|
||||
logger.info(`[MCP][User: ${userId}] All connections processed for disconnection.`);
|
||||
}
|
||||
/**
|
||||
* Always clear the activity timestamp, even when userMap was missing.
|
||||
* `updateUserLastActivity` can be called before a connection is established
|
||||
* (e.g. in MCPManager.callTool prior to getConnection); if that connection
|
||||
* attempt fails, the activity entry would otherwise leak and trigger the
|
||||
* idle check repeatedly for the same userId.
|
||||
*/
|
||||
this.userLastActivity.delete(userId);
|
||||
}
|
||||
|
||||
/** Check for and disconnect idle connections */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue