1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 22:18:07 +08:00

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

This commit is contained in:
zhengkunwang 2023-08-29 14:32:17 +08:00 committed by GitHub
parent d1e7b36243
commit 49e3d45912
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,18 +143,17 @@ func (a *AppInstallService) CheckExist(req request.AppInstalledInfo) (*response.
var appInstall model.AppInstall var appInstall model.AppInstall
if len(req.Name) == 0 { if len(req.Name) == 0 {
appInstall, _ := appInstallRepo.GetFirst(appInstallRepo.WithAppId(app.ID)) appInstall, _ = appInstallRepo.GetFirst(appInstallRepo.WithAppId(app.ID))
} else {
appInstall, _ = appInstallRepo.GetFirst(commonRepo.WithByName(req.Name))
}
if reflect.DeepEqual(appInstall, model.AppInstall{}) { if reflect.DeepEqual(appInstall, model.AppInstall{}) {
return res, nil return res, nil
} }
if err := syncById(appInstall.ID); err != nil { if err = syncById(appInstall.ID); err != nil {
return nil, err return nil, err
} }
appInstall, _ = appInstallRepo.GetFirst(commonRepo.WithByID(appInstall.ID))
} else {
appInstall, _ = appInstallRepo.GetFirst(commonRepo.WithByName(req.Name))
}
res.ContainerName = appInstall.ContainerName res.ContainerName = appInstall.ContainerName
res.Name = appInstall.Name res.Name = appInstall.Name