mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-01-18 06:30:07 +08:00
Merge pull request #126 from yanyiwu/master
FIXED: When RaftServer cannot find a leader, Return a more readable erro...
This commit is contained in:
commit
d47a6701c6
@ -133,7 +133,12 @@ func (ms *MasterServer) submitFromMasterServerHandler(w http.ResponseWriter, r *
|
||||
if ms.Topo.IsLeader() {
|
||||
submitForClientHandler(w, r, "localhost:"+strconv.Itoa(ms.port))
|
||||
} else {
|
||||
submitForClientHandler(w, r, ms.Topo.RaftServer.Leader())
|
||||
masterUrl, err := ms.Topo.Leader()
|
||||
if err != nil {
|
||||
writeJsonError(w, r, http.StatusInternalServerError, err)
|
||||
} else {
|
||||
submitForClientHandler(w, r, masterUrl)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user