frontend: add the abilities to customized timeout time (#51)
* main.go: add timeout setting * lgproxy.go: use timeout setting when querying server * README.md: add new timeout setting
This commit is contained in:
@@ -47,7 +47,7 @@ func batchRequest(servers []string, endpoint string, command string) []string {
|
||||
}
|
||||
url := "http://" + hostname + ":" + strconv.Itoa(setting.proxyPort) + "/" + url.PathEscape(endpoint) + "?q=" + url.QueryEscape(command)
|
||||
go func(url string, i int) {
|
||||
client := http.Client{Timeout: 120 * time.Second}
|
||||
client := http.Client{Timeout: time.Duration(setting.timeOut) * time.Second}
|
||||
response, err := client.Get(url)
|
||||
if err != nil {
|
||||
ch <- channelData{i, "request failed: " + err.Error() + "\n"}
|
||||
|
||||
Reference in New Issue
Block a user