mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-01 13:33:48 +08:00
Go: fix nats and go command (#16828)
### Summary 1. update docker compose file to start NATS healthy 2. Add two commands ``` RAGFlow(admin)> live; SUCCESS RAGFlow(admin)> health; +---------------+-------+ | field | value | +---------------+-------+ | storage | ok | | message_queue | ok | | status | ok | | db | ok | | redis | ok | | doc_engine | ok | +---------------+-------+ ``` --------- Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -56,9 +56,25 @@ type ErrorResponse struct {
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
// Health check
|
||||
func (h *Handler) Health(c *gin.Context) {
|
||||
c.JSON(200, gin.H{"status": "ok"})
|
||||
// Healthz to get system health
|
||||
func (h *Handler) Healthz(c *gin.Context) {
|
||||
result, allOK := service.GetComponentsHealthz(c.Request.Context())
|
||||
if allOK {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"code": 0,
|
||||
"data": result,
|
||||
})
|
||||
} else {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{
|
||||
"code": common.CodeServerError,
|
||||
"data": result,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Live endpoint
|
||||
func (h *Handler) Live(c *gin.Context) {
|
||||
common.SuccessNoData(c, "")
|
||||
}
|
||||
|
||||
// Ping ping endpoint
|
||||
|
||||
Reference in New Issue
Block a user