Skip to content

Commit

Permalink
Fix some cleanup logic on Starlette adapter.
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed Apr 22, 2024
1 parent 75807c3 commit 193ef7c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions twitchio/web/starlette_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,22 @@ async def close(self) -> None:
e,
)

self._runner_task = None
await self.client.close()
self._runner_task = None
await self.client.close()

logger.info("Successfully shutdown TwitchIO <%s>.", self.__class__.__qualname__)

async def run(self, host: str | None = None, port: int | None = None) -> None:
self._host = host or self._host
self._port = port or self._port

config: uvicorn.Config = uvicorn.Config(app=self, host=self._host, port=self._port, log_level="critical")
config: uvicorn.Config = uvicorn.Config(
app=self,
host=self._host,
port=self._port,
log_level="critical",
workers=0,
)
server: uvicorn.Server = uvicorn.Server(config)

self._runner_task = asyncio.create_task(
Expand Down

0 comments on commit 193ef7c

Please sign in to comment.