mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 00:09:16 +08:00
feat(appstore): Handle Requests After Application Installation (#7206)
This commit is contained in:
parent
83ce744fb2
commit
3e96e83c3c
@ -91,10 +91,6 @@ func (a AppService) PageApp(req request.AppSearch) (interface{}, error) {
|
||||
}
|
||||
var appDTOs []*response.AppDto
|
||||
for _, ap := range apps {
|
||||
// ap.ReadMe = ""
|
||||
// ap.Website = ""
|
||||
// ap.Document = ""
|
||||
// ap.Github = ""
|
||||
appDTO := &response.AppDto{
|
||||
ID: ap.ID,
|
||||
Name: ap.Name,
|
||||
@ -816,6 +812,14 @@ func (a AppService) SyncAppListFromRemote() (err error) {
|
||||
}
|
||||
settingService := NewISettingService()
|
||||
_ = settingService.Update("AppStoreSyncStatus", constant.Syncing)
|
||||
|
||||
defer func() {
|
||||
if err != nil {
|
||||
_ = settingService.Update("AppStoreSyncStatus", constant.SyncFailed)
|
||||
global.LOG.Errorf("App Store synchronization failed %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
setting, err := settingService.GetSettingInfo()
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -584,7 +584,7 @@ func upgradeInstall(req request.AppInstallUpgrade) error {
|
||||
_ = appDetailRepo.Update(context.Background(), detail)
|
||||
}
|
||||
go func() {
|
||||
_, _, _ = httpUtil.HandleGet(detail.DownloadCallBackUrl, http.MethodGet, constant.TimeOut5s)
|
||||
RequestDownloadCallBack(detail.DownloadCallBackUrl)
|
||||
}()
|
||||
}
|
||||
|
||||
@ -822,7 +822,7 @@ func copyData(app model.App, appDetail model.AppDetail, appInstall *model.AppIns
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
_, _, _ = httpUtil.HandleGet(appDetail.DownloadCallBackUrl, http.MethodGet, constant.TimeOut5s)
|
||||
RequestDownloadCallBack(appDetail.DownloadCallBackUrl)
|
||||
}()
|
||||
}
|
||||
appKey := app.Key
|
||||
@ -1580,3 +1580,10 @@ func isHostModel(dockerCompose string) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func RequestDownloadCallBack(downloadCallBackUrl string) {
|
||||
if downloadCallBackUrl == "" {
|
||||
return
|
||||
}
|
||||
_, _, _ = httpUtil.HandleGet(downloadCallBackUrl, http.MethodGet, constant.TimeOut5s)
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
@ -20,7 +19,6 @@ import (
|
||||
"github.com/1Panel-dev/1Panel/backend/global"
|
||||
"github.com/1Panel-dev/1Panel/backend/utils/docker"
|
||||
"github.com/1Panel-dev/1Panel/backend/utils/files"
|
||||
httpUtil "github.com/1Panel-dev/1Panel/backend/utils/http"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/subosito/gotenv"
|
||||
"gopkg.in/yaml.v3"
|
||||
@ -56,10 +54,7 @@ func handleNodeAndJava(create request.RuntimeCreate, runtime *model.Runtime, fil
|
||||
}
|
||||
|
||||
go func() {
|
||||
if _, _, err := httpUtil.HandleGet(nodeDetail.DownloadCallBackUrl, http.MethodGet, constant.TimeOut5s); err != nil {
|
||||
global.LOG.Errorf("http request failed(handleNode), err: %v", err)
|
||||
return
|
||||
}
|
||||
RequestDownloadCallBack(nodeDetail.DownloadCallBackUrl)
|
||||
}()
|
||||
go startRuntime(runtime)
|
||||
|
||||
|
@ -14,6 +14,7 @@ const (
|
||||
SyncSuccess = "SyncSuccess"
|
||||
Paused = "Paused"
|
||||
UpErr = "UpErr"
|
||||
SyncFailed = "SyncFailed"
|
||||
|
||||
ContainerPrefix = "1Panel-"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user