merge from origin master. update result_handler

This commit is contained in:
murraymack
2021-10-25 10:59:11 -06:00
parent 4ddf86035a
commit 50fde51396
2 changed files with 12 additions and 11 deletions

View File

@@ -133,4 +133,4 @@ class BOSminer(BaseMiner):
if chain['Chips'] == 0:
bad += 1
if not bad > 0:
return str(self.ip)
return str(self.ip)

View File

@@ -38,15 +38,6 @@ class CGMiner(BaseMiner):
continue
# handle result
self._result_handler(result)
if result is not None:
if result.stdout != "":
print(result.stdout)
if result.stderr != "":
print("ERROR: " + result.stderr)
elif result.stderr != "":
print("ERROR: " + result.stderr)
else:
print(cmd)
@staticmethod
def _result_handler(result: asyncssh.process.SSHCompletedProcess) -> None:
@@ -57,6 +48,16 @@ class CGMiner(BaseMiner):
print("ssh stderr: \n" + result.stderrr)
if len(result.stdout) <= 0 and len(result.stderr) <= 0:
print("ssh stdout stderr empty")
else:
print(cmd)
# if result.stdout != "":
# print(result.stdout)
# if result.stderr != "":
# print("ERROR: " + result.stderr)
# elif result.stderr != "":
# print("ERROR: " + result.stderr)
# else:
# print(cmd)
async def restart_cgminer(self) -> None:
commands = ['cgminer-api restart',
@@ -91,4 +92,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))