feat: update task status

This commit is contained in:
Ting-Jun Wang 2024-06-03 01:47:42 +08:00
parent 361988c079
commit 8642711cfc
Signed by: snsd0805
GPG Key ID: 48D331A3D6160354
2 changed files with 9 additions and 0 deletions

View File

@ -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.")

View File

@ -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)