Skip to content

Commit

Permalink
Feature/SK-559 | Dispatcher works on Windows (#489)
Browse files Browse the repository at this point in the history
Small change to not attempt to force execution in a unix shell on Windows.
  • Loading branch information
stefanhellander authored Nov 23, 2023
1 parent 192f3f1 commit 2b60de1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions fedn/fedn/network/clients/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,11 +750,11 @@ def run(self):
old_state = self.state
while True:
time.sleep(1)
cnt += 1
if cnt == 0:
logger.info("Client is active, waiting for model update requests.")
cnt = 1
if self.state != old_state:
logger.info("Client in {} state.".format(ClientStateToString(self.state)))
if cnt > 5:
cnt = 0
if not self._attached:
logger.info("Detached from combiner.")
# TODO: Implement a check/condition to ulitmately close down if too many reattachment attepts have failed. s
Expand Down
7 changes: 6 additions & 1 deletion fedn/fedn/utils/dispatcher.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from fedn.common.log_config import logger
from fedn.utils.process import run_process

Expand Down Expand Up @@ -32,7 +34,10 @@ def run_cmd(self, cmd_type):
args = cmdsandargs[1:]

# shell (this could be a venv, TODO: parametrize)
shell = ['/bin/sh', '-c']
if os.name == "nt":
shell = []
else:
shell = ['/bin/sh', '-c']

# add the corresponding process defined in project.yaml and append arguments from invoked command
args = shell + [' '.join(cmd + args)]
Expand Down

0 comments on commit 2b60de1

Please sign in to comment.