diff --git a/Makefile b/Makefile index edcf5aa05..5955ecfa4 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/backend/app/service/app.go b/backend/app/service/app.go index d750fb6a0..9f5d3dffb 100644 --- a/backend/app/service/app.go +++ b/backend/app/service/app.go @@ -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) diff --git a/backend/app/service/app_utils.go b/backend/app/service/app_utils.go index 5e7bd2256..774364482 100644 --- a/backend/app/service/app_utils.go +++ b/backend/app/service/app_utils.go @@ -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) diff --git a/frontend/src/views/app-store/installed/index.vue b/frontend/src/views/app-store/installed/index.vue index 7d4c393ce..e0435f40d 100644 --- a/frontend/src/views/app-store/installed/index.vue +++ b/frontend/src/views/app-store/installed/index.vue @@ -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')"