Set job_state to "submit" when submitting a job. Because each phase corresponds to a state in lifecycle. We can query all submitted jobs that have not been consumed in ES based on this status.
Signed-off-by: Wu Zhende wuzhende666@163.com --- src/lib/job.cr | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 63ec8fb..60e0b65 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -142,6 +142,7 @@ class Job # init job with "-1", or use the original job_content["id"] id = "-1" if "#{id}" == "" @hash["id"] = JSON::Any.new("#{id}") + self["job_state"] = "submit"
check_required_keys() check_account_info()