Files
1Panel/core/app/service/mcp_invocation_audit.go
蘭 d32cbb40f6 feat(mcp): add Panel MCP task configuration and website binding structures (#14229)
* feat(mcp): add Panel MCP task configuration and website binding structures

* fix(mcp): correct variable assignment in mcpWebsiteDomain function
2026-10-28 14:04:38 +08:00

28 lines
696 B
Go

package service
import (
"time"
"github.com/1Panel-dev/1Panel/core/app/model"
"github.com/1Panel-dev/1Panel/core/app/repo"
)
func (s *MCPService) finishInvocationAudit(record model.MCPInvocation) error {
var err error
for attempt := 0; attempt < 3; attempt++ {
if attempt > 0 {
time.Sleep(time.Duration(attempt) * 50 * time.Millisecond)
}
err = (repo.MCPRepo{DB: s.DB}).UpdateRunningInvocation(record)
if err == nil {
return nil
}
}
return err
}
func (s *MCPService) RecoverInterruptedInvocations(processStartedAt time.Time) error {
now := s.Now()
return (repo.MCPRepo{DB: s.DB}).UpdateInterruptedInvocations(processStartedAt, "failed", "MCP_OUTCOME_UNKNOWN", now)
}