expect more errors from SSE connection.
This commit is contained in:
parent
daff019920
commit
232de067a4
3 changed files with 3 additions and 4 deletions
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ class LntxbotWallet(Wallet):
|
|||
data = json.loads(line[5:])
|
||||
if "payment_hash" in data and data.get("msatoshi") > 0:
|
||||
yield data["payment_hash"]
|
||||
except (OSError, httpx.ReadError):
|
||||
except (OSError, httpx.ReadError, httpx.ReadTimeout, httpx.ConnectError):
|
||||
pass
|
||||
|
||||
print("lost connection to lntxbot /payments/stream, retrying in 5 seconds")
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ class SparkWallet(Wallet):
|
|||
data = json.loads(line[5:])
|
||||
if "pay_index" in data and data.get("status") == "paid":
|
||||
yield data["label"]
|
||||
except (OSError, httpx.ReadError, httpx.ConnectError):
|
||||
except (OSError, httpx.ReadError, httpx.ConnectError, httpx.ReadTimeout):
|
||||
pass
|
||||
|
||||
print("lost connection to spark /stream, retrying in 5 seconds")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue