expect more errors from SSE connection.

This commit is contained in:
fiatjaf
2021-04-21 23:27:57 -03:00
parent daff019920
commit 232de067a4
3 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -123,7 +123,6 @@ class LNbitsWallet(Wallet):
async with client.stream("GET", url) as r:
async for line in r.aiter_lines():
if line.startswith("data:"):
try:
data = json.loads(line[5:])
except json.decoder.JSONDecodeError:
@@ -134,7 +133,7 @@ class LNbitsWallet(Wallet):
yield data["payment_hash"] # payment_hash
except (OSError, httpx.ReadError, httpx.ConnectError):
except (OSError, httpx.ReadError, httpx.ConnectError, httpx.ReadTimeout):
pass
print("lost connection to lnbits /payments/sse, retrying in 5 seconds")