Skip to content
Snippets Groups Projects
Commit 5b098ea6 authored by Philip ABBET's avatar Philip ABBET
Browse files

Update error management in the WorkerController <-> Worker protocol

parent c7956abb
No related branches found
No related tags found
No related merge requests found
......@@ -242,8 +242,12 @@ def main(user_input=None):
content = simplejson.dumps(result['result'])
logger.debug('send: """%s"""' % content.rstrip())
status = WorkerController.DONE
if result['result']['status'] != 0:
status = WorkerController.JOB_ERROR
message = [
WorkerController.DONE,
status,
current_job_id,
content
]
......@@ -262,6 +266,7 @@ def main(user_input=None):
message = [
WorkerController.ERROR,
current_job_id,
result['system_error']
]
......
......@@ -139,6 +139,10 @@ class WorkerController(object):
job_id = int(data[0])
return (address, status, job_id, data[1:])
elif (status == WorkerController.ERROR) and (len(data) >= 2):
job_id = int(data[0])
return (address, status, job_id, data[1:])
else:
job_id = None
return (address, status, job_id, data)
......
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