morffix/task/healthcheck.go
2024-05-07 18:52:06 +02:00

17 lines
366 B
Go

package task
import "git.lastassault.de/speatzle/morffix/constants"
type HealthCheckData struct {
Command string `json:"command"`
}
func (t *Task) RunHealthCheck(data HealthCheckData) {
defer func() {
if t.Status == constants.TASK_STATUS_RUNNING {
t.Status = constants.TASK_STATUS_FAILED
t.Log = append(t.Log, "Task Status Failed by Defer")
}
}()
}