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 }