forked from LBRYCommunity/lbry-sdk
catch the right error, boris
This commit is contained in:
parent
19c3b2f4b6
commit
68d1157495
1 changed files with 2 additions and 2 deletions
|
@ -92,7 +92,7 @@ async def monitor(db, server):
|
||||||
async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(10)) as session:
|
async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(10)) as session:
|
||||||
try:
|
try:
|
||||||
ws = await session.ws_connect(server)
|
ws = await session.ws_connect(server)
|
||||||
except (aiohttp.ClientConnectorError, asyncio.TimeoutError):
|
except (aiohttp.ClientConnectionError, asyncio.TimeoutError):
|
||||||
if first_attempt:
|
if first_attempt:
|
||||||
print(f"failed connecting to {server}")
|
print(f"failed connecting to {server}")
|
||||||
await boris_says(random.choice([
|
await boris_says(random.choice([
|
||||||
|
@ -130,7 +130,7 @@ async def monitor(db, server):
|
||||||
await handle_analytics_event(c, event, server)
|
await handle_analytics_event(c, event, server)
|
||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
except (aiohttp.ClientConnectorError, asyncio.TimeoutError):
|
except (aiohttp.ClientConnectionError, asyncio.TimeoutError):
|
||||||
await boris_says(random.choice([
|
await boris_says(random.choice([
|
||||||
f"<!channel> Guys, we have a problem! Nobody home at {server}. Will check on it again in {delay} seconds.",
|
f"<!channel> Guys, we have a problem! Nobody home at {server}. Will check on it again in {delay} seconds.",
|
||||||
f"<!channel> Something wrong with {server}. I think dead. Will poke it again in {delay} seconds.",
|
f"<!channel> Something wrong with {server}. I think dead. Will poke it again in {delay} seconds.",
|
||||||
|
|
Loading…
Reference in a new issue