feat: update task status
This commit is contained in:
parent
361988c079
commit
8642711cfc
@ -127,6 +127,10 @@ class NodeManager():
|
||||
# start training
|
||||
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:
|
||||
print("[ERROR] Connected Failed.")
|
||||
|
||||
@ -54,5 +54,10 @@ class Scheduler():
|
||||
for event in event_filter.get_new_entries():
|
||||
if event['args']['provider'] == address:
|
||||
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