added a try except block for logging errors per miner in the testbench

This commit is contained in:
UpstreamData
2022-04-19 10:15:12 -06:00
parent c7b7a6e7c5
commit 0739a7f689
2 changed files with 25 additions and 18 deletions

View File

@@ -73,12 +73,15 @@ class TestbenchMiner:
miner = await MinerFactory().get_miner(self.host)
await self.add_to_output("Found miner: " + str(miner))
if isinstance(miner, BOSMinerS9):
try:
if await self.get_bos_version() == self.latest_version:
await self.add_to_output(
f"Already running the latest version of BraiinsOS, {self.latest_version}, configuring."
)
self.state = REFERRAL
return
except AttributeError:
return
await self.add_to_output("Already running BraiinsOS, updating.")
self.state = UPDATE
return
@@ -295,6 +298,7 @@ class TestbenchMiner:
async def install_loop(self):
self.latest_version = sorted(await get_local_versions(), reverse=True)[0]
while True:
try:
if self.state == START:
self.start_time = None
await self.install_start()
@@ -308,3 +312,5 @@ class TestbenchMiner:
await self.install_referral()
if self.state == DONE:
await self.install_done()
except Exception as E:
logging.error(f"{self.host}: {E}")

View File

@@ -1,5 +1,6 @@
from tools.web_testbench.app import app
import uvicorn
from logger import logger
def main():
uvicorn.run("web_testbench:app", host="0.0.0.0", port=80)