added settings.py file for managing retries and "threads", as well as fixing some bugs in the APIs

This commit is contained in:
UpstreamData
2021-12-21 11:57:34 -07:00
parent 43af332199
commit df6858d718
8 changed files with 40 additions and 23 deletions

View File

@@ -22,10 +22,10 @@ class CGMiner(BaseMiner):
return data.stdout.strip()
else:
return "CGMiner Unknown"
except Exception as e:
except Exception:
return "CGMiner Unknown"
async def send_config(self):
async def send_config(self, _):
return None # ignore for now
async def _get_ssh_connection(self) -> asyncssh.connect:
@@ -36,7 +36,7 @@ class CGMiner(BaseMiner):
password=self.pwd,
server_host_key_algs=['ssh-rsa'])
return conn
except asyncssh.misc.PermissionDenied as e:
except asyncssh.misc.PermissionDenied:
try:
conn = await asyncssh.connect(str(self.ip),
known_hosts=None,
@@ -50,7 +50,6 @@ class CGMiner(BaseMiner):
print(str(self.ip) + " Connection refused.")
return None
async def send_ssh_command(self, cmd):
result = None
async with (await self._get_ssh_connection()) as conn:
@@ -116,4 +115,4 @@ class CGMiner(BaseMiner):
result = await conn.run(command, check=True)
self._result_handler(result)
self.config = result.stdout
print(str(self.config))
print(str(self.config))