[go: nahoru, domu]

Skip to content

Commit

Permalink
fix(kernel): baseClient timeout setting fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
motian committed Jun 16, 2024
1 parent 3e4241f commit 3228816
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 3228816

Please sign in to comment.