fix: 解决本地应用升级失败的问题 (#1248)

This commit is contained in:
zhengkunwang223 2023-06-05 13:45:26 +08:00 committed by GitHub
parent b2e17d4c42
commit 5e7524e4f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 8 deletions

View File

@ -34,3 +34,5 @@ build_backend_on_archlinux:
&& CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -trimpath -ldflags '-s -w --extldflags "-fpic"' -tags osusergo -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
build_all: build_frontend build_backend_on_linux
build_on_local: clean_asserts build_frontend build_backend_on_darwin upx_bin

View File

@ -354,9 +354,6 @@ func (a AppService) Install(ctx context.Context, req request.AppInstallCreate) (
if err = upAppPre(app, appInstall); err != nil {
return
}
go func() {
_, _ = http.Get(appDetail.DownloadCallBackUrl)
}()
upApp(appInstall)
}()
go updateToolApp(appInstall)

View File

@ -242,11 +242,15 @@ func upgradeInstall(installId uint, detailId uint) error {
}
}()
if upErr = downloadApp(install.App, detail, &install); upErr != nil {
return
}
detailDir := path.Join(constant.ResourceDir, "apps", install.App.Resource, install.App.Key, detail.Version)
if install.App.Resource == constant.AppResourceRemote {
if upErr = downloadApp(install.App, detail, &install); upErr != nil {
return
}
go func() {
_, _ = http.Get(detail.DownloadCallBackUrl)
}()
}
if install.App.Resource == constant.AppResourceLocal {
detailDir = path.Join(constant.ResourceDir, "apps", "local", strings.TrimPrefix(install.App.Key, "local"), detail.Version)
}
@ -462,6 +466,9 @@ func copyData(app model.App, appDetail model.AppDetail, appInstall *model.AppIns
if err != nil {
return
}
go func() {
_, _ = http.Get(appDetail.DownloadCallBackUrl)
}()
}
appKey := app.Key
installAppDir := path.Join(constant.AppInstallDir, app.Key)

View File

@ -169,7 +169,8 @@
round
size="small"
:disabled="
installed.status !== 'Running' ||
(installed.status !== 'Running' &&
installed.status !== 'UpgradeErr') ||
installed.app.status === 'TakeDown'
"
@click="openOperate(installed, 'upgrade')"