Skip to content

Commit

Permalink
Fixes Tribler#7592: remove the wait_for wrapper around `await site.…
Browse files Browse the repository at this point in the history
…start()` when starting HTTP REST API server
  • Loading branch information
kozlovsky committed Oct 2, 2023
1 parent c7f5d8a commit e68d8dd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/tribler/core/components/restapi/rest/rest_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,7 @@ async def start_http_site(self):
self._logger.info(f"Starting HTTP REST API server on port {api_port}...")

try:
# The self.site.start() is expected to start immediately. It looks like on some machines, it hangs.
# The timeout is added to prevent the hypothetical hanging.
await asyncio.wait_for(self.site.start(), timeout=SITE_START_TIMEOUT)

await self.site.start()
except BaseException as e:
self._logger.exception(f"Can't start HTTP REST API on port {api_port}: {e.__class__.__name__}: {e}")
raise
Expand Down

0 comments on commit e68d8dd

Please sign in to comment.