Create a task to start_servers()

That way we start waiting on the shutdown event no matter what
so we can always be shut down
This commit is contained in:
Neil Booth 2018-07-25 22:02:00 +08:00
parent 365c217031
commit 5e4586ce54

View File

@ -103,7 +103,7 @@ class ServerBase(object):
partial(self.on_signal, signame))
loop.set_exception_handler(self.on_exception)
await self.start_servers()
self.tasks.create_task(self.start_servers())
# Wait for shutdown to be signalled, and log it.
# Derived classes may want to provide a shutdown() coroutine.