task wip
This commit is contained in:
parent
172bf636d6
commit
a040d5d56c
6 changed files with 123 additions and 3 deletions
17
task/healthcheck.go
Normal file
17
task/healthcheck.go
Normal 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
9
task/task.go
Normal 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"`
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue