Skip to content

Commit b3f31bb

Browse files
Simplify task proto
Signed-off-by: Shah, Karan <kbshah1998@outlook.com>
1 parent fb0f7ef commit b3f31bb

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

openfl/transport/grpc/aggregator_server.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -157,27 +157,7 @@ def GetTasks(self, request, context): # NOQA:N802
157157
tasks, round_number, sleep_time, time_to_quit = self.aggregator.get_tasks(
158158
request.header.sender
159159
)
160-
if tasks:
161-
if isinstance(tasks[0], str):
162-
# backward compatibility
163-
tasks_proto = [
164-
aggregator_pb2.Task(
165-
name=task,
166-
)
167-
for task in tasks
168-
]
169-
else:
170-
tasks_proto = [
171-
aggregator_pb2.Task(
172-
name=task.name,
173-
function_name=task.function_name,
174-
task_type=task.task_type,
175-
apply_local=task.apply_local,
176-
)
177-
for task in tasks
178-
]
179-
else:
180-
tasks_proto = []
160+
tasks_proto = [aggregator_pb2.Task(name=task) for task in tasks]
181161

182162
header = create_header(
183163
sender=self.aggregator.uuid,

0 commit comments

Comments
 (0)