Skip to content

Commit

Permalink
Merge pull request #503 from motian/develop
Browse files Browse the repository at this point in the history
fix(kernel): baseClient timeout setting fixed
  • Loading branch information
Matrix-X committed Jun 16, 2024
2 parents 3e4241f + 3228816 commit fa7c98a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/kernel/baseClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/http"
"strconv"
"strings"
"time"

"github.com/ArtisanCloud/PowerLibs/v3/http/contract"
"github.com/ArtisanCloud/PowerLibs/v3/http/helper"
Expand Down Expand Up @@ -53,13 +54,15 @@ func NewBaseClient(app *ApplicationInterface, token *AccessToken) (*BaseClient,
config := (*app).GetConfig()
baseURI := config.GetString("http.base_uri", "/")
proxyURI := config.GetString("http.proxy_uri", "")
timeout := config.GetFloat64("http.timeout", 5)

if token == nil {
token = (*app).GetAccessToken()
}
h, err := helper.NewRequestHelper(&helper.Config{
BaseUrl: baseURI,
ClientConfig: &contract.ClientConfig{
Timeout: time.Duration(timeout * float64(time.Second)),
ProxyURI: proxyURI,
},
})
Expand Down

0 comments on commit fa7c98a

Please sign in to comment.