mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
add 30 seconds http read timeout
This commit is contained in:
parent
819de58197
commit
d2dd7d1694
|
@ -10,6 +10,7 @@ import (
|
|||
"pkg/topology"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -140,7 +141,12 @@ func runMaster(cmd *Command, args []string) bool {
|
|||
topo.StartRefreshWritableVolumes()
|
||||
|
||||
log.Println("Start Weed Master", VERSION, "at port", strconv.Itoa(*mport))
|
||||
e := http.ListenAndServe(":"+strconv.Itoa(*mport), nil)
|
||||
srv := &http.Server{
|
||||
Addr:":"+strconv.Itoa(*mport),
|
||||
Handler: http.DefaultServeMux,
|
||||
ReadTimeout: 30*time.Second,
|
||||
}
|
||||
e := srv.ListenAndServe()
|
||||
if e != nil {
|
||||
log.Fatalf("Fail to start:%s", e.Error())
|
||||
}
|
||||
|
|
|
@ -272,8 +272,13 @@ func runVolume(cmd *Command, args []string) bool {
|
|||
}()
|
||||
log.Println("store joined at", *masterNode)
|
||||
|
||||
log.Println("Start Weed volume server", VERSION, "at http://" + *ip + ":" + strconv.Itoa(*vport))
|
||||
e := http.ListenAndServe(":"+strconv.Itoa(*vport), nil)
|
||||
log.Println("Start Weed volume server", VERSION, "at http://"+*ip+":"+strconv.Itoa(*vport))
|
||||
srv := &http.Server{
|
||||
Addr:":"+strconv.Itoa(*vport),
|
||||
Handler: http.DefaultServeMux,
|
||||
ReadTimeout: 30*time.Second,
|
||||
}
|
||||
e := srv.ListenAndServe()
|
||||
if e != nil {
|
||||
log.Fatalf("Fail to start:%s", e.Error())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue