Drop shutdown_servers flag
@@ -301,12 +301,12 @@ class Server:
self.force_exit = False
self.last_notified = 0
- def run(self, sockets=None, shutdown_servers=True):
+ def run(self, sockets=None):
self.config.setup_event_loop()
loop = asyncio.get_event_loop()
loop.run_until_complete(self.serve(sockets=sockets))
- async def serve(self, sockets=None, shutdown_servers=True):
+ async def serve(self, sockets=None):
process_id = os.getpid()
config = self.config
@@ -323,7 +323,7 @@ class Server:
if self.should_exit:
return
await self.main_loop()
- await self.shutdown(shutdown_servers=shutdown_servers)
+ await self.shutdown()
self.logger.info("Finished server process [{}]".format(process_id))
async def startup(self, sockets=None):
@@ -414,11 +414,10 @@ class Server:
return self.server_state.total_requests >= self.config.limit_max_requests
return False
- async def shutdown(self, shutdown_servers=True):
+ async def shutdown(self):
self.logger.info("Shutting down")
# Stop accepting new connections.
- if shutdown_servers:
for server in self.servers:
server.close()
for server in self.servers:
