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

Function checkLimit

agent/app/service/app_utils.go:975–986  ·  view source on GitHub ↗
(app model.App)

Source from the content-addressed store, hash-verified

973}
974
975func checkLimit(app model.App) error {
976 if app.Limit > 0 {
977 installs, err := appInstallRepo.ListBy(context.Background(), appInstallRepo.WithAppId(app.ID))
978 if err != nil {
979 return err
980 }
981 if len(installs) >= app.Limit {
982 return buserr.New("ErrAppLimit")
983 }
984 }
985 return nil
986}
987
988func checkRequiredAndLimit(app model.App) error {
989 if err := checkLimit(app); err != nil {

Callers 2

checkRequiredAndLimitFunction · 0.85
GetAppDetailMethod · 0.85

Calls 2

ListByMethod · 0.65
WithAppIdMethod · 0.65

Tested by

no test coverage detected