Add job_state to indicates the status of a customized job. Add source to specify source.
Signed-off-by: Wu Zhende wuzhende666@163.com --- src/lib/scheduler_api.cr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/lib/scheduler_api.cr b/src/lib/scheduler_api.cr index b8dd514..50dc495 100644 --- a/src/lib/scheduler_api.cr +++ b/src/lib/scheduler_api.cr @@ -10,9 +10,11 @@ class SchedulerAPI @host = ENV.has_key?("SCHED_HOST") ? ENV["SCHED_HOST"] : "172.17.0.1" end
- def close_job(job_id) + def close_job(job_id, job_state = nil, source=nil) + url = "/~lkp/cgi-bin/lkp-post-run?job_id=#{job_id}&source=#{source}" + url += "&job_state=#{job_state}" if job_state client = HTTP::Client.new(@host, port: @port) - response = client.get("/~lkp/cgi-bin/lkp-post-run?job_id=#{job_id}") + response = client.get(url) client.close() return response end