add job type to the job state change struct (#759)

This commit is contained in:
Marko Gacesa 2023-11-02 15:49:58 +00:00 committed by Harness
parent b221ed9080
commit 12c38f88a9
3 changed files with 3 additions and 0 deletions

View File

@ -126,6 +126,7 @@ func (e *Executor) exec(
jobDummy := &types.Job{ jobDummy := &types.Job{
UID: jobUID, UID: jobUID,
Type: jobType,
Updated: time.Now().UnixMilli(), Updated: time.Now().UnixMilli(),
Result: result, Result: result,
State: enum.JobStateRunning, State: enum.JobStateRunning,

View File

@ -32,6 +32,7 @@ const (
func encodeStateChange(job *types.Job) ([]byte, error) { func encodeStateChange(job *types.Job) ([]byte, error) {
stateChange := &types.JobStateChange{ stateChange := &types.JobStateChange{
UID: job.UID, UID: job.UID,
Type: job.Type,
State: job.State, State: job.State,
Progress: job.RunProgress, Progress: job.RunProgress,
Result: job.Result, Result: job.Result,

View File

@ -42,6 +42,7 @@ type Job struct {
type JobStateChange struct { type JobStateChange struct {
UID string `json:"uid"` UID string `json:"uid"`
Type string `json:"type"`
State enum.JobState `json:"state"` State enum.JobState `json:"state"`
Progress int `json:"progress"` Progress int `json:"progress"`
Result string `json:"result"` Result string `json:"result"`