fixed a bug with the async with statements

This commit is contained in:
UpstreamData
2021-10-26 13:29:28 -06:00
parent edbd1bbe94
commit 1372183af8
3 changed files with 7 additions and 10 deletions

View File

@@ -27,7 +27,7 @@ class CGMiner(BaseMiner):
async def send_ssh_command(self, cmd):
result = None
async with self._get_ssh_connection() as conn:
async with (await self._get_ssh_connection()) as conn:
for i in range(3):
try:
result = await conn.run(cmd)
@@ -86,7 +86,7 @@ class CGMiner(BaseMiner):
await self.send_ssh_command(commands)
async def get_config(self) -> None:
async with self._get_ssh_connection() as conn:
async with (await self._get_ssh_connection()) as conn:
command = 'cat /etc/config/cgminer'
result = await conn.run(command, check=True)
self._result_handler(result)