未验证 提交 303cfe0d 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #1951 from taosdata/feature/blm-bugfix

[None-Jira]response ealier to improve writing speed
......@@ -184,6 +184,7 @@ func main() {
}
http.HandleFunc("/receive", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusAccepted)
addr := strings.Split(r.RemoteAddr, ":")
idx := TAOShashID([]byte(addr[0]))
......@@ -192,7 +193,7 @@ func main() {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
r.Body.Close()
reqBuf, err := snappy.Decode(nil, compressed)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
......@@ -205,7 +206,7 @@ func main() {
return
}
nodeChans[idx%httpworkers] <- req
w.WriteHeader(http.StatusAccepted)
})
http.HandleFunc("/check", func(w http.ResponseWriter, r *http.Request) {
......
......@@ -149,6 +149,7 @@ func main() {
}
http.HandleFunc("/telegraf", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusAccepted)
addr := strings.Split(r.RemoteAddr, ":")
idx := TAOShashID([]byte(addr[0]))
......@@ -157,7 +158,7 @@ func main() {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
r.Body.Close()
var req Metrics
if err := json.Unmarshal(reqBuf, &req); err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
......@@ -166,7 +167,7 @@ func main() {
req.HostIP = addr[0]
nodeChans[idx%httpworkers] <- req
w.WriteHeader(http.StatusAccepted)
//w.WriteHeader(http.StatusAccepted)
})
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNoContent)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册