mirror of
				https://gitea.com/gitea/gitea-mcp.git
				synced 2025-11-03 20:01:50 +00:00 
			
		
		
		
	feat: configure HTTP server heartbeat interval to 30 seconds
- Import the time package to support time-based configuration - Set the HTTP server's heartbeat interval to 30 seconds using a new option in its initialization Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
		@@ -2,6 +2,7 @@ package operation
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"gitea.com/gitea/gitea-mcp/operation/issue"
 | 
			
		||||
	"gitea.com/gitea/gitea-mcp/operation/pull"
 | 
			
		||||
@@ -61,6 +62,7 @@ func Run() error {
 | 
			
		||||
		httpServer := server.NewStreamableHTTPServer(
 | 
			
		||||
			mcpServer,
 | 
			
		||||
			server.WithLogger(log.New()),
 | 
			
		||||
			server.WithHeartbeatInterval(30*time.Second),
 | 
			
		||||
		)
 | 
			
		||||
		log.Infof("Gitea MCP HTTP server listening on :%d", flag.Port)
 | 
			
		||||
		if err := httpServer.Start(fmt.Sprintf(":%d", flag.Port)); err != nil {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user