mirror of
https://gitea.com/gitea/gitea-mcp.git
synced 2025-08-23 14:23:05 +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 (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
"gitea.com/gitea/gitea-mcp/operation/issue"
|
"gitea.com/gitea/gitea-mcp/operation/issue"
|
||||||
"gitea.com/gitea/gitea-mcp/operation/pull"
|
"gitea.com/gitea/gitea-mcp/operation/pull"
|
||||||
@@ -61,6 +62,7 @@ func Run() error {
|
|||||||
httpServer := server.NewStreamableHTTPServer(
|
httpServer := server.NewStreamableHTTPServer(
|
||||||
mcpServer,
|
mcpServer,
|
||||||
server.WithLogger(log.New()),
|
server.WithLogger(log.New()),
|
||||||
|
server.WithHeartbeatInterval(30*time.Second),
|
||||||
)
|
)
|
||||||
log.Infof("Gitea MCP HTTP server listening on :%d", flag.Port)
|
log.Infof("Gitea MCP HTTP server listening on :%d", flag.Port)
|
||||||
if err := httpServer.Start(fmt.Sprintf(":%d", flag.Port)); err != nil {
|
if err := httpServer.Start(fmt.Sprintf(":%d", flag.Port)); err != nil {
|
||||||
|
Reference in New Issue
Block a user