From 7d8fad267abd8710d1751828fd39dc0a11ab8596 Mon Sep 17 00:00:00 2001 From: blackcoffeexbt <87530449+blackcoffeexbt@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:02:55 +0100 Subject: [PATCH] fix: set a maximium sleep time when retrying to connect to the funding source (#2622) --------- Co-authored-by: Pavol Rusnak --- lnbits/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnbits/app.py b/lnbits/app.py index a7b12e9c4..3854c173c 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -206,7 +206,7 @@ async def check_funding_source() -> None: break retry_counter += 1 - sleep_time = 0.25 * (2**retry_counter) + sleep_time = min(0.25 * (2**retry_counter), 60) logger.warning( f"Retrying connection to backend in {sleep_time} seconds... " f"({retry_counter}/{max_retries})"