Skip to content

Commit fa7c98a

Browse files
authored
Merge pull request #503 from motian/develop
fix(kernel): baseClient timeout setting fixed
2 parents 3e4241f + 3228816 commit fa7c98a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/kernel/baseClient.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"net/http"
1010
"strconv"
1111
"strings"
12+
"time"
1213

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

5759
if token == nil {
5860
token = (*app).GetAccessToken()
5961
}
6062
h, err := helper.NewRequestHelper(&helper.Config{
6163
BaseUrl: baseURI,
6264
ClientConfig: &contract.ClientConfig{
65+
Timeout: time.Duration(timeout * float64(time.Second)),
6366
ProxyURI: proxyURI,
6467
},
6568
})

0 commit comments

Comments
 (0)