mirror of
https://github.com/samanhappy/mcphub.git
synced 2025-12-23 18:29:21 -05:00
Improve comments in setupKeepAlive function for clarity
Co-authored-by: samanhappy <2755122+samanhappy@users.noreply.github.com>
This commit is contained in:
@@ -31,12 +31,12 @@ const servers: { [sessionId: string]: Server } = {};
|
|||||||
|
|
||||||
// Helper function to set up keep-alive ping for SSE connections
|
// Helper function to set up keep-alive ping for SSE connections
|
||||||
const setupKeepAlive = (serverInfo: ServerInfo, serverConfig: ServerConfig): void => {
|
const setupKeepAlive = (serverInfo: ServerInfo, serverConfig: ServerConfig): void => {
|
||||||
// Only set up keep-alive for SSE connections when keepAlive is explicitly enabled
|
// Only applicable to SSE connections
|
||||||
if (!(serverInfo.transport instanceof SSEClientTransport)) {
|
if (!(serverInfo.transport instanceof SSEClientTransport)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if keepAlive is explicitly enabled (default is false to avoid excessive API calls)
|
// Keep-alive is disabled by default to avoid excessive API calls to external MCP servers
|
||||||
if (serverConfig.keepAlive !== true) {
|
if (serverConfig.keepAlive !== true) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user