From fbcb3da422217e8a1a5e37281bdefb6e43c8815c Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <31820853+zhengkunwang223@users.noreply.github.com> Date: Thu, 29 Jun 2023 15:02:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9B=E5=BB=BA=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=A2=9E=E5=8A=A0=E6=8B=89=E5=8F=96=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=AC=20(#1486)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/app.go | 8 +++----- backend/app/service/runtime.go | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/backend/app/service/app.go b/backend/app/service/app.go index 26620d71a..8c6a4437a 100644 --- a/backend/app/service/app.go +++ b/backend/app/service/app.go @@ -163,7 +163,7 @@ func (a AppService) GetAppDetail(appId uint, version, appType string) (response. } fileOp := files.NewFileOp() versionPath := path.Join(constant.AppResourceDir, app.Resource, app.Key, detail.Version) - if !fileOp.Stat(versionPath) { + if !fileOp.Stat(versionPath) || detail.Update { if err = downloadApp(app, detail, nil); err != nil { return appDetailDTO, err } @@ -730,10 +730,8 @@ func (a AppService) SyncAppListFromRemote() error { detail.Params = string(paramByte) detail.DownloadUrl = v.DownloadUrl detail.DownloadCallBackUrl = v.DownloadCallBackUrl - if v.LastModified > detail.LastModified { - detail.Update = true - detail.LastModified = v.LastModified - } + detail.Update = true + detail.LastModified = v.LastModified detailsMap[version] = detail } var newDetails []model.AppDetail diff --git a/backend/app/service/runtime.go b/backend/app/service/runtime.go index 74ed4945e..b69588460 100644 --- a/backend/app/service/runtime.go +++ b/backend/app/service/runtime.go @@ -65,7 +65,7 @@ func (r *RuntimeService) Create(create request.RuntimeCreate) (err error) { } fileOp := files.NewFileOp() appVersionDir := path.Join(constant.AppResourceDir, app.Resource, app.Key, appDetail.Version) - if !fileOp.Stat(appVersionDir) { + if !fileOp.Stat(appVersionDir) || appDetail.Update { if err := downloadApp(app, appDetail, nil); err != nil { return err }