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

Method deleteCheckByAgent

agent/app/service/agents.go:807–823  ·  view source on GitHub ↗
(agent *model.Agent)

Source from the content-addressed store, hash-verified

805}
806
807func (a AgentService) deleteCheckByAgent(agent *model.Agent) ([]dto.AppResource, error) {
808 if agent == nil || agent.WebsiteID == 0 {
809 return nil, nil
810 }
811 website, err := websiteRepo.GetFirst(repo.WithByID(agent.WebsiteID))
812 if err != nil {
813 if err == gorm.ErrRecordNotFound {
814 return nil, nil
815 }
816 return nil, err
817 }
818 websiteName, err := loadAgentWebsiteResourceName(website)
819 if err != nil {
820 return nil, err
821 }
822 return []dto.AppResource{{Type: "website", Name: websiteName}}, nil
823}
824
825func syncAgentAppInstalls(appInstalls []model.AppInstall) {
826 if len(appInstalls) == 0 {

Callers 2

DeleteMethod · 0.95
DeleteCheckMethod · 0.95

Calls 3

GetFirstMethod · 0.65
WithByIDMethod · 0.65

Tested by

no test coverage detected