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

Function agentNameExists

agent/app/service/agents.go:650–661  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

648}
649
650func agentNameExists(name string) (bool, error) {
651 if exist, err := agentRepo.GetFirst(repo.WithByLowerName(name)); err == nil && exist != nil && exist.ID > 0 {
652 return true, nil
653 } else if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
654 return false, err
655 }
656 installs, err := appInstallRepo.ListBy(context.Background(), repo.WithByLowerName(name))
657 if err != nil {
658 return false, err
659 }
660 return len(installs) > 0, nil
661}
662
663func buildBatchInstallOpenclawAllowedOrigin(req dto.AgentBatchInstallReq) (string, error) {
664 host := ""

Callers 1

Calls 3

IsMethod · 0.80
GetFirstMethod · 0.65
ListByMethod · 0.65

Tested by

no test coverage detected