mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-11-13 08:06:06 +00:00
* feat(mcp): add Panel MCP task configuration and website binding structures * fix(mcp): correct variable assignment in mcpWebsiteDomain function
28 lines
696 B
Go
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)
|
|
}
|