Skip to content

Commit

Permalink
fix: 解决 PHP 运行环境版本过期之后下载安装包失败的问题 (1Panel-dev#6125)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengkunwang223 authored Aug 14, 2024
1 parent b3c1366 commit 266d589
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/app/service/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
4 changes: 4 additions & 0 deletions backend/utils/http/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package http

import (
"context"
"errors"
"io"
"net/http"
"time"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 266d589

Please # to comment.