(name string)
| 648 | } |
| 649 | |
| 650 | func 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 | |
| 663 | func buildBatchInstallOpenclawAllowedOrigin(req dto.AgentBatchInstallReq) (string, error) { |
| 664 | host := "" |
no test coverage detected