ソースを参照

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().
Paul Klumpp 1 週間 前
コミット
5a48b14ccc
1 ファイル変更0 行追加5 行削除
  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."""