From ce0342e2350ecade12d515231dfe4fe368b6e50c Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <31820853+zhengkunwang223@users.noreply.github.com> Date: Tue, 30 May 2023 14:46:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20nexus=20=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98=20(#1189?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs https://github.com/1Panel-dev/1Panel/issues/1179 --- backend/app/service/app.go | 6 +++--- backend/app/service/app_install.go | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/app/service/app.go b/backend/app/service/app.go index 05feb5001..d43362efe 100644 --- a/backend/app/service/app.go +++ b/backend/app/service/app.go @@ -335,9 +335,6 @@ func (a AppService) Install(ctx context.Context, req request.AppInstallCreate) ( if err = createLink(ctx, app, appInstall, req.Params); err != nil { return } - if err = upAppPre(app, appInstall); err != nil { - return - } go func() { if err = copyData(app, appDetail, appInstall, req); err != nil { if appInstall.Status == constant.Installing { @@ -347,6 +344,9 @@ func (a AppService) Install(ctx context.Context, req request.AppInstallCreate) ( _ = appInstallRepo.Save(context.Background(), appInstall) return } + if err = upAppPre(app, appInstall); err != nil { + return + } go func() { _, _ = http.Get(appDetail.DownloadCallBackUrl) }() diff --git a/backend/app/service/app_install.go b/backend/app/service/app_install.go index 69e7d5ce3..d2801b5e3 100644 --- a/backend/app/service/app_install.go +++ b/backend/app/service/app_install.go @@ -257,6 +257,9 @@ func (a *AppInstallService) Update(req request.AppInstalledUpdate) error { backupDockerCompose := installed.DockerCompose if req.Advanced { composeMap := make(map[string]interface{}) + if err = yaml.Unmarshal([]byte(installed.DockerCompose), &composeMap); err != nil { + return err + } if err := addDockerComposeCommonParam(composeMap, installed.ServiceName, req.AppContainerConfig, req.Params); err != nil { return err }