Skip to content

Commit

Permalink
Merge branch 'fix/slots' into test/fix-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramimashkouk committed Oct 28, 2024
2 parents 0b888b5 + 2c4a105 commit dd4f67c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
6 changes: 5 additions & 1 deletion backend/chatsky_ui/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ def run_scenario(
script_path = settings.scripts_dir / f"build_{build_id}.yaml"

command_to_run = f"python {project_dir}/app.py --script-path {script_path}"
asyncio.run(_execute_command(command_to_run))
try:
asyncio.run(_execute_command(command_to_run))
except FileNotFoundError:
command_to_run = f"python3 {project_dir}/app.py --script-path {script_path}"
asyncio.run(_execute_command(command_to_run))


@cli.command("run_app")
Expand Down
13 changes: 1 addition & 12 deletions backend/chatsky_ui/services/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,18 +180,7 @@ async def write_stdin(self, message: bytes) -> None:

async def is_alive(self) -> bool:
"""Checks if the process is alive by writing to stdin andreading its stdout."""
message = b"Hi\n"
try:
# Attempt to write and read from the process with a timeout.
await self.write_stdin(message)
output = await asyncio.wait_for(self.read_stdout(), timeout=PING_PONG_TIMEOUT)
if not output:
return False
self.logger.debug("Process is alive and output afer communication is: %s", output.decode())
return True
except asyncio.exceptions.TimeoutError:
self.logger.debug("Process is still running.")
return False
return True


class RunProcess(Process):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const SlotCondition = ({ condition, setData }: ConditionModalContentType) => {
value: slot.name,
}))}
placeholder="Choose slot"
onValueChange={(value) => setSelectedSlot(value)}
/>
</TableCell>
</TableRow>
Expand Down

0 comments on commit dd4f67c

Please sign in to comment.