mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-10 23:47:39 +08:00
feat: 创建运行环境增加拉取最新版本 (#1486)
This commit is contained in:
parent
3978fb3e46
commit
fbcb3da422
2 changed files with 4 additions and 6 deletions
|
@ -163,7 +163,7 @@ func (a AppService) GetAppDetail(appId uint, version, appType string) (response.
|
||||||
}
|
}
|
||||||
fileOp := files.NewFileOp()
|
fileOp := files.NewFileOp()
|
||||||
versionPath := path.Join(constant.AppResourceDir, app.Resource, app.Key, detail.Version)
|
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 {
|
if err = downloadApp(app, detail, nil); err != nil {
|
||||||
return appDetailDTO, err
|
return appDetailDTO, err
|
||||||
}
|
}
|
||||||
|
@ -730,10 +730,8 @@ func (a AppService) SyncAppListFromRemote() error {
|
||||||
detail.Params = string(paramByte)
|
detail.Params = string(paramByte)
|
||||||
detail.DownloadUrl = v.DownloadUrl
|
detail.DownloadUrl = v.DownloadUrl
|
||||||
detail.DownloadCallBackUrl = v.DownloadCallBackUrl
|
detail.DownloadCallBackUrl = v.DownloadCallBackUrl
|
||||||
if v.LastModified > detail.LastModified {
|
detail.Update = true
|
||||||
detail.Update = true
|
detail.LastModified = v.LastModified
|
||||||
detail.LastModified = v.LastModified
|
|
||||||
}
|
|
||||||
detailsMap[version] = detail
|
detailsMap[version] = detail
|
||||||
}
|
}
|
||||||
var newDetails []model.AppDetail
|
var newDetails []model.AppDetail
|
||||||
|
|
|
@ -65,7 +65,7 @@ func (r *RuntimeService) Create(create request.RuntimeCreate) (err error) {
|
||||||
}
|
}
|
||||||
fileOp := files.NewFileOp()
|
fileOp := files.NewFileOp()
|
||||||
appVersionDir := path.Join(constant.AppResourceDir, app.Resource, app.Key, appDetail.Version)
|
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 {
|
if err := downloadApp(app, appDetail, nil); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue