This commit is contained in:
speatzle 2024-05-07 18:52:06 +02:00
parent 172bf636d6
commit a040d5d56c
6 changed files with 123 additions and 3 deletions

17
task/healthcheck.go Normal file
View file

@ -0,0 +1,17 @@
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")
}
}()
}

9
task/task.go Normal file
View file

@ -0,0 +1,9 @@
package task
type Task struct {
ID int `json:"id"`
FileID int `json:"file_id"`
Type int `json:"type"`
Status int `json:"status"`
Log []string `json:"log"`
}