Merge pull request #2102 from lbryio/shutdown_fast

Set a shutdown timeout for TCPSite to avoid hanging on exit
This commit is contained in:
Jack Robison 2019-05-09 10:24:13 -04:00 committed by GitHub
commit 7cdb7987e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -403,7 +403,7 @@ class Daemon(metaclass=JSONRPCServerType):
await self.runner.setup() await self.runner.setup()
try: try:
site = web.TCPSite(self.runner, self.conf.api_host, self.conf.api_port) site = web.TCPSite(self.runner, self.conf.api_host, self.conf.api_port, shutdown_timeout=.5)
await site.start() await site.start()
log.info('lbrynet API listening on TCP %s:%i', *site._server.sockets[0].getsockname()[:2]) log.info('lbrynet API listening on TCP %s:%i', *site._server.sockets[0].getsockname()[:2])
except OSError as e: except OSError as e: