2022-05-19 13:47:27 +00:00
|
|
|
package v1
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (c *Controller) HeartBeat(gctx *gin.Context) {
|
2024-02-23 13:03:50 +00:00
|
|
|
machineID, _ := getMachineIDFromContext(gctx)
|
2022-05-19 13:47:27 +00:00
|
|
|
|
|
|
|
if err := c.DBClient.UpdateMachineLastHeartBeat(machineID); err != nil {
|
|
|
|
c.HandleDBErrors(gctx, err)
|
|
|
|
return
|
|
|
|
}
|
2024-01-15 10:44:38 +00:00
|
|
|
|
2022-05-19 13:47:27 +00:00
|
|
|
gctx.Status(http.StatusOK)
|
|
|
|
}
|