@@ -26,8 +26,7 @@ import (
2626 "github.com/1Panel-dev/1Panel/agent/utils/common"
2727 "github.com/1Panel-dev/1Panel/agent/utils/docker"
2828 "github.com/1Panel-dev/1Panel/agent/utils/files"
29- http2 "github.com/1Panel-dev/1Panel/agent/utils/http"
30- httpUtil "github.com/1Panel-dev/1Panel/agent/utils/http"
29+ "github.com/1Panel-dev/1Panel/agent/utils/req_helper"
3130 "github.com/1Panel-dev/1Panel/agent/utils/xpack"
3231 "gopkg.in/yaml.v3"
3332)
@@ -260,7 +259,7 @@ func (a AppService) GetAppDetail(appID uint, version, appType string) (response.
260259 if appDetailDTO .DockerCompose == "" {
261260 filename := filepath .Base (appDetailDTO .DownloadUrl )
262261 dockerComposeUrl := fmt .Sprintf ("%s%s" , strings .TrimSuffix (appDetailDTO .DownloadUrl , filename ), "docker-compose.yml" )
263- statusCode , composeRes , err := httpUtil . HandleGet (dockerComposeUrl , http .MethodGet , constant .TimeOut20s )
262+ statusCode , composeRes , err := req_helper . HandleRequest (dockerComposeUrl , http .MethodGet , constant .TimeOut20s )
264263 if err != nil {
265264 return appDetailDTO , buserr .WithDetail ("ErrGetCompose" , err .Error (), err )
266265 }
@@ -773,7 +772,7 @@ func (a AppService) GetAppUpdate() (*response.AppUpdateRes, error) {
773772 }
774773
775774 versionUrl := fmt .Sprintf ("%s/%s/1panel.json.version.txt" , global .CONF .System .AppRepo , global .CONF .System .Mode )
776- _ , versionRes , err := http2 . HandleGet (versionUrl , http .MethodGet , constant .TimeOut20s )
775+ _ , versionRes , err := req_helper . HandleRequest (versionUrl , http .MethodGet , constant .TimeOut20s )
777776 if err != nil {
778777 return nil , err
779778 }
@@ -936,15 +935,14 @@ func (a AppService) SyncAppListFromRemote(taskID string) (err error) {
936935 oldAppIds = append (oldAppIds , old .ID )
937936 }
938937
939- transport := xpack .LoadRequestTransport ()
940938 baseRemoteUrl := fmt .Sprintf ("%s/%s/1panel" , global .CONF .System .AppRepo , global .CONF .System .Mode )
941939
942940 appsMap := getApps (oldApps , list .Apps , setting .SystemVersion , t )
943941
944942 t .LogStart (i18n .GetMsgByKey ("SyncAppDetail" ))
945943 for _ , l := range list .Apps {
946944 app := appsMap [l .AppProperty .Key ]
947- _ , iconRes , err := httpUtil . HandleGetWithTransport (l .Icon , http .MethodGet , transport , constant .TimeOut20s )
945+ _ , iconRes , err := req_helper . HandleRequest (l .Icon , http .MethodGet , constant .TimeOut20s )
948946 if err != nil {
949947 return err
950948 }
@@ -977,7 +975,7 @@ func (a AppService) SyncAppListFromRemote(taskID string) (err error) {
977975 }
978976 if _ , ok := InitTypes [app .Type ]; ok {
979977 dockerComposeUrl := fmt .Sprintf ("%s/%s" , versionUrl , "docker-compose.yml" )
980- _ , composeRes , err := httpUtil . HandleGetWithTransport (dockerComposeUrl , http .MethodGet , transport , constant .TimeOut20s )
978+ _ , composeRes , err := req_helper . HandleRequest (dockerComposeUrl , http .MethodGet , constant .TimeOut20s )
981979 if err != nil {
982980 return err
983981 }
0 commit comments