Fix Message object attribute access in job monitoring

- Change response.get('msg_type') to response.msg_type
- Change response.get('data') to response.data
- Message objects don't have get method, use attributes instead
parent 384c96f5
...@@ -647,8 +647,8 @@ class ClusterMaster: ...@@ -647,8 +647,8 @@ class ClusterMaster:
# Try to receive response # Try to receive response
response = backend_comm.receive_message() response = backend_comm.receive_message()
if response and response.get('msg_type') in ['analyze_response', 'train_response']: if response and response.msg_type in ['analyze_response', 'train_response']:
result_data = response.get('data', {}) result_data = response.data
print(f"Received result for job {job_id}") print(f"Received result for job {job_id}")
# Handle result # Handle result
...@@ -662,7 +662,7 @@ class ClusterMaster: ...@@ -662,7 +662,7 @@ class ClusterMaster:
del self.pending_jobs[job_id] del self.pending_jobs[job_id]
return return
elif response and response.get('msg_type') == 'result_pending': elif response and response.msg_type == 'result_pending':
# Result not ready yet, wait and try again # Result not ready yet, wait and try again
await asyncio.sleep(1) await asyncio.sleep(1)
continue continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment