Add ping message handling in cluster_master for remote workers

parent 839f119c
...@@ -297,6 +297,13 @@ class ClusterMaster: ...@@ -297,6 +297,13 @@ class ClusterMaster:
progress = message.data.get('progress', 0) progress = message.data.get('progress', 0)
progress_message = message.data.get('message', '') progress_message = message.data.get('message', '')
update_job_progress(job_id, progress, progress_message) update_job_progress(job_id, progress, progress_message)
elif msg_type == 'ping':
# Handle ping messages from remote workers to reset timeout
job_id = message.data.get('job_id')
if job_id and job_id in self.active_jobs:
self.active_jobs[job_id]['last_progress'] = time.time()
print(f"Ping received for job {job_id} - resetting timeout")
return {'type': 'progress_ack'} return {'type': 'progress_ack'}
elif msg_type == 'ping': elif msg_type == 'ping':
......
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