From 9c3faca667e3d7250b8bfa80ccfac984dcdc4e1a Mon Sep 17 00:00:00 2001 From: UpstreamData Date: Wed, 3 Nov 2021 09:49:21 -0600 Subject: [PATCH] fixed a bug with get_hashrate --- miners/bosminer.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/miners/bosminer.py b/miners/bosminer.py index d0d783bd..e17876cd 100644 --- a/miners/bosminer.py +++ b/miners/bosminer.py @@ -65,9 +65,13 @@ class BOSminer(BaseMiner): self.config = cfg async def get_hostname(self) -> str: - async with (await self._get_ssh_connection()) as conn: - data = await conn.run('cat /proc/sys/kernel/hostname') - return data.stdout.strip() + try: + async with (await self._get_ssh_connection()) as conn: + data = await conn.run('cat /proc/sys/kernel/hostname') + return data.stdout.strip() + except Exception as e: + print(self.ip, e) + return "BOSMiner Unknown" async def send_config(self, yaml_config) -> None: toml_conf = await general_config_convert_bos(yaml_config)