[PATCH compass-ci 6/7] scheduler: update job parameter in etcd

Signed-off-by: Cao Xueliang <caoxl78320@163.com> --- src/lib/sched.cr | 7 ------- src/scheduler/update_job_parameter.cr | 9 ++++++++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/sched.cr b/src/lib/sched.cr index f74df9b..6fd6657 100644 --- a/src/lib/sched.cr +++ b/src/lib/sched.cr @@ -166,13 +166,6 @@ class Sched @es.update_tbox(testbox.to_s, hash) end - def update_testbox_time(job_id) - job = @redis.get_job(job_id) - testbox = job["testbox"] - hash = {"time" => @env.get?("time").to_s} - @es.update_tbox(testbox, hash) - end - def report_ssh_port testbox = @env.params.query["tbox_name"] ssh_port = @env.params.query["ssh_port"].to_s diff --git a/src/scheduler/update_job_parameter.cr b/src/scheduler/update_job_parameter.cr index 92b905e..28ab0f2 100644 --- a/src/scheduler/update_job_parameter.cr +++ b/src/scheduler/update_job_parameter.cr @@ -27,7 +27,7 @@ class Sched job_content[parameter] = value end - @redis.update_job(job_content) + update_id2job(job_content) # json log log = job_content.dup @@ -46,4 +46,11 @@ class Sched } spawn mq_publish_confirm(JOB_MQ, mq_msg.to_json) end + + def update_testbox_time(job_id) + job = get_id2job(job_id) + testbox = job["testbox"] + hash = {"time" => @env.get?("time").to_s} + @es.update_tbox(testbox, hash) + end end -- 2.23.0
participants (1)
-
Cao Xueliang