Skip to content

Commit

Permalink
Update logs
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll committed Jun 9, 2024
1 parent 472fcc5 commit 6eaa147
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/py/flwr/cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
)

app.command()(new)
app.command()(logs)
app.command()(example)
app.command()(run)
app.command()(build)
Expand Down
7 changes: 4 additions & 3 deletions src/py/flwr/superexec/exec_servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ExecServicer(exec_pb2_grpc.ExecServicer):

def __init__(self, plugin: Executor) -> None:
self.plugin = plugin
self.runs: Dict[int, subprocess.Popen[str]] = {}
self.runs: Dict[int, Popen[str]] = {}
self.logs = []
self.lock = threading.Lock()

Expand All @@ -59,11 +59,12 @@ def StartRun(

def _capture_logs(self, proc):
select_timeout = 1.0

def run():
while True:
reads, _, _ = select.select([proc.stdout], [], [], select_timeout)
reads, _, _ = select.select([proc.stderr], [], [], select_timeout)
if reads:
line = proc.stdout.readline()
line = proc.stderr.readline()
if line:
self.logs.append(line.rstrip())

Expand Down

0 comments on commit 6eaa147

Please sign in to comment.