2024-08-14 10:15:55 +08:00
|
|
|
package v2
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/1Panel-dev/1Panel/agent/app/api/v2/helper"
|
2024-08-21 15:14:50 +08:00
|
|
|
"github.com/1Panel-dev/1Panel/agent/utils/xpack"
|
2024-08-14 10:15:55 +08:00
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (b *BaseApi) CheckHealth(c *gin.Context) {
|
2024-08-21 15:14:50 +08:00
|
|
|
_, err := xpack.RequestToMaster("/api/v2/agent/health", http.MethodGet, nil)
|
2024-08-14 10:15:55 +08:00
|
|
|
if err != nil {
|
2024-10-29 18:42:12 +08:00
|
|
|
helper.InternalServer(c, err)
|
2024-08-14 10:15:55 +08:00
|
|
|
return
|
|
|
|
}
|
|
|
|
helper.SuccessWithOutData(c)
|
|
|
|
}
|