feat: update task status
This commit is contained in:
parent
361988c079
commit
8642711cfc
@ -127,6 +127,10 @@ class NodeManager():
|
|||||||
# start training
|
# start training
|
||||||
self.cluster_communication_module.scatter_container(train_image, train=True)
|
self.cluster_communication_module.scatter_container(train_image, train=True)
|
||||||
|
|
||||||
|
print("Update the task's status...")
|
||||||
|
self.scheduler.update_status(self.wallet, task_index, 4)
|
||||||
|
print("Finished.")
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("[ERROR] Connected Failed.")
|
print("[ERROR] Connected Failed.")
|
||||||
|
|||||||
@ -55,4 +55,9 @@ class Scheduler():
|
|||||||
if event['args']['provider'] == address:
|
if event['args']['provider'] == address:
|
||||||
return event
|
return event
|
||||||
|
|
||||||
|
def update_status(self, account, task_index, new_status):
|
||||||
|
function = self.contract.functions.updateStatus(task_index, new_status)
|
||||||
|
return self.signed_and_send_transaction(account, function)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user