Selaa lähdekoodia

Drop duplicate sleep from the realtime reconnect loop

The loop slept via _sleep_interruptible() and then again on a never
updated `backoff` variable — an extra, non-interruptible second per
reconnect that also delayed disconnect().

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Paul-Dieter Klumpp 1 viikko sitten
vanhempi
commit
c67aded50c
1 muutettua tiedostoa jossa 0 lisäystä ja 5 poistoa
  1. 0 5
      adapter.py

+ 0 - 5
adapter.py

@@ -519,9 +519,6 @@ class ChattoAdapter(BasePlatformAdapter):
         stream_events() which provides pre-decoded RealtimeEvent objects.
         """
 
-        # Ensure ws_ready is available for synchronization with starter
-        backoff = ChattoConstants.WS_RECONNECT_INITIAL_BACKOFF
-
         delay = ChattoConstants.WS_RECONNECT_INITIAL_BACKOFF
         while not self._closing:
             try:
@@ -575,8 +572,6 @@ class ChattoAdapter(BasePlatformAdapter):
             await self._sleep_interruptible(delay + jitter)
             delay = min(delay * 2, ChattoConstants.WS_RECONNECT_MAX_BACKOFF)
 
-            await asyncio.sleep(backoff)
-
 
     async def _sleep_interruptible(self, seconds: float) -> None:
         """Sleep in short slices so disconnect() cancels promptly."""