fix: 解决 Openresty 获取状态异常的问题 (#2104)

This commit is contained in:
zhengkunwang
2023-08-29 06:32:17 +00:00
committed by GitHub
parent d1e7b36243
commit 49e3d45912
+7 -8
View File
@@ -143,17 +143,16 @@ func (a *AppInstallService) CheckExist(req request.AppInstalledInfo) (*response.
var appInstall model.AppInstall
if len(req.Name) == 0 {
appInstall, _ := appInstallRepo.GetFirst(appInstallRepo.WithAppId(app.ID))
if reflect.DeepEqual(appInstall, model.AppInstall{}) {
return res, nil
}
if err := syncById(appInstall.ID); err != nil {
return nil, err
}
appInstall, _ = appInstallRepo.GetFirst(commonRepo.WithByID(appInstall.ID))
appInstall, _ = appInstallRepo.GetFirst(appInstallRepo.WithAppId(app.ID))
} else {
appInstall, _ = appInstallRepo.GetFirst(commonRepo.WithByName(req.Name))
}
if reflect.DeepEqual(appInstall, model.AppInstall{}) {
return res, nil
}
if err = syncById(appInstall.ID); err != nil {
return nil, err
}
res.ContainerName = appInstall.ContainerName