File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -96,8 +96,9 @@ async def ensure_connection(self):
9696 )
9797
9898 await asyncio .sleep (retry_delay )
99- # Exponential backoff with cap
100- retry_delay = min (retry_delay * 1.2 , 30.0 ) # Cap at 30 seconds
99+
100+ # Exponential backoff with cap at 30 seconds
101+ retry_delay = min (retry_delay * 1.2 , 30.0 )
101102
102103 async def wait_until_ready (self , name : str ):
103104 await self .ensure_connection ()
Original file line number Diff line number Diff line change @@ -595,7 +595,8 @@ async def _notify_with_retry(self, ready) -> bool:
595595 if attempt < max_retries - 1 : # Don't delay on last attempt
596596 # Adaptive delay: wait 2-5x the time it took for the check
597597 # This accounts for Redis load, network latency, etc.
598- adaptive_delay = max (base_delay , check_duration * (2 + attempt * 1.5 ))
598+ # Cap at 30 seconds to avoid excessive waits during Redis recovery
599+ adaptive_delay = min (max (base_delay , check_duration * (2 + attempt * 1.5 )), 30.0 )
599600
600601 btul .logging .debug (
601602 f"🔄 Retry { attempt + 1 } /{ max_retries } : check took { check_duration * 1000 :.1f} ms, "
You can’t perform that action at this time.
0 commit comments