From 89628fbbcc35330aa5b05aa5f213a58695d8c3eb Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Thu, 11 Jul 2024 11:19:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=AE=89=E8=A3=85=20m?= =?UTF-8?q?ailserver=20=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98=20(#5?= =?UTF-8?q?756)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/app.go | 7 ------- backend/app/service/app_utils.go | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/app/service/app.go b/backend/app/service/app.go index 0f5e19d8e..2f557060d 100644 --- a/backend/app/service/app.go +++ b/backend/app/service/app.go @@ -445,13 +445,6 @@ func (a AppService) Install(ctx context.Context, req request.AppInstallCreate) ( } appInstall.Env = string(paramByte) - containerNames, err := getContainerNames(*appInstall) - if err != nil { - return - } - if len(containerNames) > 0 { - appInstall.ContainerName = strings.Join(containerNames, ",") - } if err = appInstallRepo.Create(ctx, appInstall); err != nil { return } diff --git a/backend/app/service/app_utils.go b/backend/app/service/app_utils.go index dd06c8737..80c740109 100644 --- a/backend/app/service/app_utils.go +++ b/backend/app/service/app_utils.go @@ -943,6 +943,13 @@ func upApp(appInstall *model.AppInstall, pullImages bool) { } exist, _ := appInstallRepo.GetFirst(commonRepo.WithByID(appInstall.ID)) if exist.ID > 0 { + containerNames, err := getContainerNames(*appInstall) + if err != nil { + return + } + if len(containerNames) > 0 { + appInstall.ContainerName = strings.Join(containerNames, ",") + } _ = appInstallRepo.Save(context.Background(), appInstall) } }