DailyTransport: don't timeout prematurely on join
This commit is contained in:
@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed an issue where `DailyTransport` would timeout prematurely on join.
|
||||||
|
|
||||||
- Fixed an issue in the runner where starting a DailyTransport room via
|
- Fixed an issue in the runner where starting a DailyTransport room via
|
||||||
`/start` didn't support using the `DAILY_SAMPLE_ROOM_URL` env var.
|
`/start` didn't support using the `DAILY_SAMPLE_ROOM_URL` env var.
|
||||||
|
|
||||||
|
|||||||
@@ -744,32 +744,27 @@ class DailyTransportClient(EventHandler):
|
|||||||
|
|
||||||
self._client.set_user_name(self._bot_name)
|
self._client.set_user_name(self._bot_name)
|
||||||
|
|
||||||
try:
|
(data, error) = await self._join()
|
||||||
(data, error) = await self._join()
|
|
||||||
|
|
||||||
if not error:
|
if not error:
|
||||||
self._joined = True
|
self._joined = True
|
||||||
self._joining = False
|
|
||||||
# Increment leave counter if we successfully joined.
|
|
||||||
self._leave_counter += 1
|
|
||||||
|
|
||||||
logger.info(f"Joined {self._room_url}")
|
|
||||||
|
|
||||||
if self._params.transcription_enabled:
|
|
||||||
await self.start_transcription(self._params.transcription_settings)
|
|
||||||
|
|
||||||
await self._callbacks.on_joined(data)
|
|
||||||
|
|
||||||
self._joined_event.set()
|
|
||||||
else:
|
|
||||||
error_msg = f"Error joining {self._room_url}: {error}"
|
|
||||||
logger.error(error_msg)
|
|
||||||
await self._callbacks.on_error(error_msg)
|
|
||||||
except asyncio.TimeoutError:
|
|
||||||
error_msg = f"Time out joining {self._room_url}"
|
|
||||||
logger.error(error_msg)
|
|
||||||
self._joining = False
|
self._joining = False
|
||||||
|
# Increment leave counter if we successfully joined.
|
||||||
|
self._leave_counter += 1
|
||||||
|
|
||||||
|
logger.info(f"Joined {self._room_url}")
|
||||||
|
|
||||||
|
if self._params.transcription_enabled:
|
||||||
|
await self.start_transcription(self._params.transcription_settings)
|
||||||
|
|
||||||
|
await self._callbacks.on_joined(data)
|
||||||
|
|
||||||
|
self._joined_event.set()
|
||||||
|
else:
|
||||||
|
error_msg = f"Error joining {self._room_url}: {error}"
|
||||||
|
logger.error(error_msg)
|
||||||
await self._callbacks.on_error(error_msg)
|
await self._callbacks.on_error(error_msg)
|
||||||
|
self._joining = False
|
||||||
|
|
||||||
async def _join(self):
|
async def _join(self):
|
||||||
"""Execute the actual room join operation."""
|
"""Execute the actual room join operation."""
|
||||||
@@ -828,7 +823,7 @@ class DailyTransportClient(EventHandler):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
return await asyncio.wait_for(future, timeout=10)
|
return await future
|
||||||
|
|
||||||
async def leave(self):
|
async def leave(self):
|
||||||
"""Leave the Daily room and cleanup resources."""
|
"""Leave the Daily room and cleanup resources."""
|
||||||
|
|||||||
Reference in New Issue
Block a user