Update cluster_master to store progress in database for both local and remote workers

parent 14d4ce69
......@@ -287,6 +287,11 @@ class ClusterMaster:
# Update the job's last activity time to reset timeout
self.active_jobs[job_id]['last_progress'] = time.time()
print(f"Progress update for job {job_id}: {message.data.get('progress', 0)}%")
# Update database for consistency (both local and remote workers)
from .database import update_job_progress
progress = message.data.get('progress', 0)
progress_message = message.data.get('message', '')
update_job_progress(job_id, progress, progress_message)
return {'type': 'progress_ack'}
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