code refactor for http server

This commit is contained in:
Ulric Qin 2022-08-03 10:52:37 +08:00
parent 17d37dc68b
commit 86c2b4b1bc
2 changed files with 4 additions and 14 deletions

View File

@ -206,14 +206,9 @@ func openFalcon(c *gin.Context) {
}
if fail > 0 {
log.Printf("falconmetric msg process error , msg is : %s\n", string(bytes))
log.Println("falcon forwarder error, message:", string(bytes))
}
writer.PostTimeSeries(series)
c.JSON(200, gin.H{
"succ": succ,
"fail": fail,
"msg": msg,
})
c.String(200, "succ:%d fail:%d message:%s", succ, fail, msg)
}

View File

@ -191,14 +191,9 @@ func openTSDB(c *gin.Context) {
}
if fail > 0 {
log.Printf("opentsdb msg process error , msg is : %s\n", string(bytes))
log.Println("opentsdb forwarder error, message:", string(bytes))
}
writer.PostTimeSeries(series)
c.JSON(200, gin.H{
"succ": succ,
"fail": fail,
"msg": msg,
})
c.String(200, "succ:%d fail:%d message:%s", succ, fail, msg)
}