Fix aiohttp handling (#512)

This commit is contained in:
Pascal Vizeli 2018-06-20 15:32:55 +02:00 committed by GitHub
parent 20e73796b8
commit e84e82d018
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,7 @@ class RestAPI(CoreSysAttributes):
# service stuff # service stuff
self._runner = web.AppRunner(self.webapp) self._runner = web.AppRunner(self.webapp)
self._site = web.TCPSite(self._runner, "0.0.0.0", 80) self._site = None
async def load(self): async def load(self):
"""Register REST API Calls.""" """Register REST API Calls."""
@ -221,6 +221,7 @@ class RestAPI(CoreSysAttributes):
async def start(self): async def start(self):
"""Run rest api webserver.""" """Run rest api webserver."""
await self._runner.setup() await self._runner.setup()
self._site = web.TCPSite(self._runner, "0.0.0.0", 80)
try: try:
await self._site.start() await self._site.start()