增加 post超时
This commit is contained in:
parent
87cde6a03a
commit
3ffa24d4fa
@ -6,6 +6,7 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type postParams struct {
|
||||
@ -50,7 +51,9 @@ func (n *NetNotifier) dispatch(params *postParams) {
|
||||
log.Println("error: json.Marshal n.params. ", err)
|
||||
return
|
||||
}
|
||||
client := &http.Client{}
|
||||
client := &http.Client{
|
||||
Timeout: time.Second * 15,
|
||||
}
|
||||
req, err := http.NewRequest("POST", n.CallUrl, bytes.NewBuffer(b))
|
||||
if err != nil {
|
||||
log.Println("error: http.NewRequest. ", err)
|
||||
|
Loading…
Reference in New Issue
Block a user