From 49e3d4591264c6457fd78df28e6fca985fc2e0ec Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Tue, 29 Aug 2023 14:32:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20Openresty=20?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=8A=B6=E6=80=81=E5=BC=82=E5=B8=B8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#2104)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/app_install.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/backend/app/service/app_install.go b/backend/app/service/app_install.go index ae0970b0f..bdf5e2d50 100644 --- a/backend/app/service/app_install.go +++ b/backend/app/service/app_install.go @@ -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