mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-23 18:49:21 +08:00
fix: 解决 PHP 运行环境版本过期之后下载安装包失败的问题 (#6125)
This commit is contained in:
parent
a85d5bad46
commit
dca3c92d72
@ -188,7 +188,7 @@ func (a AppService) GetAppDetail(appID uint, version, appType string) (response.
|
||||
|
||||
versionPath := filepath.Join(app.GetAppResourcePath(), detail.Version)
|
||||
if !fileOp.Stat(versionPath) || detail.Update {
|
||||
if err = downloadApp(app, detail, nil); err != nil {
|
||||
if err = downloadApp(app, detail, nil); err != nil && !fileOp.Stat(versionPath) {
|
||||
return appDetailDTO, err
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package http
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"net/http"
|
||||
"time"
|
||||
@ -35,6 +36,9 @@ func HandleGetWithTransport(url, method string, transport *http.Transport, timeo
|
||||
if err != nil {
|
||||
return 0, nil, err
|
||||
}
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return 0, nil, errors.New(resp.Status)
|
||||
}
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return 0, nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user