Skip to content

Commit b7f0092

Browse files
authored
Merge pull request #26 from vantage6/fix/updating_status_to_server
Updating the node status on the server when finishing a Task
2 parents f642ee5 + 4d9007a commit b7f0092

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

integration_poc/v6_k8s_node.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,8 @@ def __poll_task_results(self):
537537
{next_result}
538538
*********************************************************************************
539539
""")
540-
# notify socket channel of algorithm status change
540+
541+
# notify other nodes about algorithm status change
541542
self.socketIO.emit(
542543
"algorithm_status_change",
543544
data={
@@ -553,6 +554,25 @@ def __poll_task_results(self):
553554
)
554555

555556

557+
#Notify other nodes about algorithm status change
558+
self.log.info(f"Sending result (run={next_result.run_id}) to the server!")
559+
560+
response = self.client.request(f"task/{next_result.task_id}")
561+
562+
init_org = response.get("init_org")
563+
564+
self.client.run.patch(
565+
id_=next_result.run_id,
566+
data={
567+
"result": next_result.data,
568+
"log":next_result.logs[0],
569+
"status": next_result.status,
570+
"finished_at": datetime.datetime.now().isoformat(),
571+
},
572+
init_org_id=init_org.get("id"),
573+
)
574+
575+
556576

557577
except (KeyboardInterrupt, InterruptedError):
558578
self.log.info("Node is interrupted, shutting down...")

0 commit comments

Comments
 (0)