fix: exponential backoff for IN_FLIGHT payment polling (#3918)
This commit is contained in:
@@ -243,7 +243,7 @@ class LndRestWallet(Wallet):
|
|||||||
return PaymentPendingStatus()
|
return PaymentPendingStatus()
|
||||||
|
|
||||||
url = f"/v2/router/track/{checking_id}"
|
url = f"/v2/router/track/{checking_id}"
|
||||||
async with self.client.stream("GET", url, timeout=None) as r:
|
async with self.client.stream("GET", url, timeout=30) as r:
|
||||||
async for json_line in r.aiter_lines():
|
async for json_line in r.aiter_lines():
|
||||||
try:
|
try:
|
||||||
line = json.loads(json_line)
|
line = json.loads(json_line)
|
||||||
@@ -274,7 +274,7 @@ class LndRestWallet(Wallet):
|
|||||||
return PaymentFailedStatus()
|
return PaymentFailedStatus()
|
||||||
elif status == "IN_FLIGHT":
|
elif status == "IN_FLIGHT":
|
||||||
logger.info(f"LNDRest Payment in flight: {checking_id}")
|
logger.info(f"LNDRest Payment in flight: {checking_id}")
|
||||||
return PaymentPendingStatus()
|
continue
|
||||||
|
|
||||||
logger.info(f"LNDRest Payment non-existent: {checking_id}")
|
logger.info(f"LNDRest Payment non-existent: {checking_id}")
|
||||||
return PaymentPendingStatus()
|
return PaymentPendingStatus()
|
||||||
|
|||||||
Reference in New Issue
Block a user