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:
Bo-Yi Wu
2025-07-18 10:11:58 +08:00
parent 5dbfe21127
commit 093cddbcb6

View File

@@ -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 {