diff --git a/app/services/job/executor.go b/app/services/job/executor.go index e88efe779..ea5bad887 100644 --- a/app/services/job/executor.go +++ b/app/services/job/executor.go @@ -126,6 +126,7 @@ func (e *Executor) exec( jobDummy := &types.Job{ UID: jobUID, + Type: jobType, Updated: time.Now().UnixMilli(), Result: result, State: enum.JobStateRunning, diff --git a/app/services/job/pubsub.go b/app/services/job/pubsub.go index 773612a9d..6b36c07fe 100644 --- a/app/services/job/pubsub.go +++ b/app/services/job/pubsub.go @@ -32,6 +32,7 @@ const ( func encodeStateChange(job *types.Job) ([]byte, error) { stateChange := &types.JobStateChange{ UID: job.UID, + Type: job.Type, State: job.State, Progress: job.RunProgress, Result: job.Result, diff --git a/types/job.go b/types/job.go index 4e706ffe6..dec58fbd6 100644 --- a/types/job.go +++ b/types/job.go @@ -42,6 +42,7 @@ type Job struct { type JobStateChange struct { UID string `json:"uid"` + Type string `json:"type"` State enum.JobState `json:"state"` Progress int `json:"progress"` Result string `json:"result"`