Skip to content

Commit

Permalink
Improve shutdown method
Browse files Browse the repository at this point in the history
  • Loading branch information
drew2a committed Feb 27, 2023
1 parent 40d45bd commit c3551b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tribler/core/components/restapi/rest/rest_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ async def shutdown(self):
return
self._shutdown = True

shutdown_group = AsyncGroup()
for endpoint in self.endpoints.values():
if isinstance(endpoint, RESTEndpoint): # IPV8RootEndpoint doesn't have a shutdown method
await endpoint.shutdown()
if isinstance(endpoint, RESTEndpoint):
shutdown_group.add(endpoint.shutdown()) # IPV8RootEndpoint doesn't have a shutdown method

await shutdown_group.wait()
await self.async_group.cancel()


Expand Down

0 comments on commit c3551b2

Please sign in to comment.