Skip to content

Commit

Permalink
Fix validation
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll committed Mar 28, 2024
1 parent da1587e commit 8057db1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/cc/flwr/src/communicator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bool validate_task_ins(const flwr::proto::TaskIns &task_ins,

bool validate_task_res(const flwr::proto::TaskRes &task_res) {
// Retrieve initialized fields in TaskRes
return (!task_res.task_id().empty());
return true;
}

flwr::proto::TaskRes
Expand Down
14 changes: 10 additions & 4 deletions src/cc/flwr/src/message_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ handle_task(flwr_local::Client *client, const flwr::proto::TaskIns &task_ins) {

flwr::proto::TaskRes task_res;

task_res.set_task_id("");
task_res.set_group_id(task_ins.group_id());
task_res.set_run_id(task_ins.run_id());

std::unique_ptr<flwr::proto::Task> task =
std::make_unique<flwr::proto::Task>();

Expand All @@ -82,10 +86,12 @@ handle_task(flwr_local::Client *client, const flwr::proto::TaskIns &task_ins) {

task->set_allocated_recordset(proto_recordset_ptr.release());
task->set_task_type(received_task.task_type());
task->set_ttl(3600);
task->set_created_at(std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::system_clock::now().time_since_epoch())
.count());
task->set_ttl("");
task->set_created_at("");
task->set_allocated_consumer(
std::make_unique<flwr::proto::Node>(received_task.producer()).release());
task->set_allocated_producer(
std::make_unique<flwr::proto::Node>(received_task.consumer()).release());

task_res.set_allocated_task(task.release());

Expand Down

0 comments on commit 8057db1

Please sign in to comment.