mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
deal with empty learder() cases
This commit is contained in:
parent
1040761ab6
commit
f8b1d48f82
|
@ -94,8 +94,8 @@ func (ms *MasterServer) proxyToLeader(f func(w http.ResponseWriter, r *http.Requ
|
||||||
ms.bounedLeaderChan <- 1
|
ms.bounedLeaderChan <- 1
|
||||||
defer func() { <-ms.bounedLeaderChan }()
|
defer func() { <-ms.bounedLeaderChan }()
|
||||||
targetUrl, err := url.Parse("http://" + ms.Topo.RaftServer.Leader())
|
targetUrl, err := url.Parse("http://" + ms.Topo.RaftServer.Leader())
|
||||||
if err != nil {
|
if err != nil || ms.Topo.RaftServer.Leader() == "" {
|
||||||
writeJsonQuiet(w, r, map[string]interface{}{"error": "Leader URL Parse Error " + err.Error()})
|
writeJsonQuiet(w, r, map[string]interface{}{"error": "Leader URL http://" + ms.Topo.RaftServer.Leader() + " Parse Error " + err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
glog.V(4).Infoln("proxying to leader", ms.Topo.RaftServer.Leader())
|
glog.V(4).Infoln("proxying to leader", ms.Topo.RaftServer.Leader())
|
||||||
|
|
Loading…
Reference in a new issue