MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / loadBatchAgentInstall

Function loadBatchAgentInstall

agent/app/service/agents.go:485–499  ·  view source on GitHub ↗
(agent model.Agent, agentType string)

Source from the content-addressed store, hash-verified

483}
484
485func loadBatchAgentInstall(agent model.Agent, agentType string) (batchAgentInstallContext, string) {
486 ctx := batchAgentInstallContext{agent: agent}
487 if agent.AppInstallID == 0 {
488 return ctx, "agent app install id is empty"
489 }
490 install, err := appInstallRepo.GetFirst(repo.WithByID(agent.AppInstallID))
491 if err != nil {
492 return ctx, err.Error()
493 }
494 ctx.install = install
495 if install.App.Key != agentType {
496 return ctx, fmt.Sprintf("app key %s does not match agent type %s", install.App.Key, agentType)
497 }
498 return ctx, ""
499}
500
501func buildBatchUpgradePlans(req dto.AgentBatchUpgradeReq) ([]batchUpgradePlan, []dto.AgentBatchUpgradeResult, error) {
502 agents, err := listBatchAgents(req.AgentType)

Callers 3

BatchInstallSkillMethod · 0.85
BatchOperateMethod · 0.85
buildBatchUpgradePlansFunction · 0.85

Calls 3

GetFirstMethod · 0.65
WithByIDMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected