Skip to content
Snippets Groups Projects
Commit 2cb687ad authored by Iustin Pop's avatar Iustin Pop
Browse files

Reuse the luxi client in cli.SubmitOpCode

By a mistake, we don't reuse the luxi client. As such, we open and close
the connection at each poll cycle and spam the server logs.

Reviewed-by: ultrotter
parent 3b316acb
No related branches found
No related tags found
No related merge requests found
...@@ -380,7 +380,7 @@ def SubmitOpCode(op, proc=None, feedback_fn=None): ...@@ -380,7 +380,7 @@ def SubmitOpCode(op, proc=None, feedback_fn=None):
# TODO: Fix feedback_fn situation. # TODO: Fix feedback_fn situation.
cl = luxi.Client() cl = luxi.Client()
job = opcodes.Job(op_list=[op]) job = opcodes.Job(op_list=[op])
jid = SubmitJob(job) jid = SubmitJob(job, cl)
query = { query = {
"object": "jobs", "object": "jobs",
...@@ -389,7 +389,7 @@ def SubmitOpCode(op, proc=None, feedback_fn=None): ...@@ -389,7 +389,7 @@ def SubmitOpCode(op, proc=None, feedback_fn=None):
} }
while True: while True:
jdata = SubmitQuery(query) jdata = SubmitQuery(query, cl)
if not jdata: if not jdata:
# job not found, go away! # job not found, go away!
raise errors.JobLost("Job with id %s lost" % jid) raise errors.JobLost("Job with id %s lost" % jid)
...@@ -400,7 +400,7 @@ def SubmitOpCode(op, proc=None, feedback_fn=None): ...@@ -400,7 +400,7 @@ def SubmitOpCode(op, proc=None, feedback_fn=None):
time.sleep(1) time.sleep(1)
query["fields"].extend(["op_list", "op_status", "op_result"]) query["fields"].extend(["op_list", "op_status", "op_result"])
jdata = SubmitQuery(query) jdata = SubmitQuery(query, cl)
if not jdata: if not jdata:
raise errors.JobLost("Job with id %s lost" % jid) raise errors.JobLost("Job with id %s lost" % jid)
status, op_list, op_status, op_result = jdata[0] status, op_list, op_status, op_result = jdata[0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment