Overwrite uvicorn loggers.

This commit is contained in:
grossmj committed 2020-10-22 19:56:53 +10:30
1 parent 13da8aa8f5
commit 97a91f1899
4 files changed
+48 -19

No files matched your search

+3 -2
View File
@@ -21,6 +21,7 @@ import json
import uuid
import socket
import shutil
import asyncio
from ..config import Config
from .project import Project
@@ -91,7 +92,7 @@ class Controller:
user=server_config.get("user", ""),
password=server_config.get("password", ""),
force=True,
connect=False)
connect=True)
except ControllerError:
log.fatal("Cannot access to the local server, make sure something else is not running on the TCP port {}".format(port))
sys.exit(1)
@@ -311,7 +312,7 @@ class Controller:
self._computes[compute.id] = compute
self.save()
if connect:
await compute.connect()
asyncio.ensure_future(compute.connect())
self.notification.controller_emit("compute.created", compute.__json__())
return compute
else:
+3 -3
View File
@@ -105,7 +105,7 @@ class Compute:
def _session(self):
if self._http_session is None or self._http_session.closed is True:
connector = aiohttp.TCPConnector(force_close=True)
connector = aiohttp.TCPConnector(limit=None, force_close=True)
self._http_session = aiohttp.ClientSession(connector=connector)
return self._http_session
@@ -464,7 +464,7 @@ class Compute:
elif response.type == aiohttp.WSMsgType.CLOSED:
pass
break
except aiohttp.ClientError as e:
except aiohttp.client_exceptions.ClientResponseError as e:
log.error("Client response error received on compute '{}' WebSocket '{}': {}".format(self._id, ws_url,e))
finally:
self._connected = False
@@ -594,8 +594,8 @@ class Compute:
"""
Forward a call to the emulator on compute
"""
action = "/{}/{}".format(type, path)
try:
action = "/{}/{}".format(type, path)
res = await self.http_query(method, action, data=data, timeout=None)
except aiohttp.ServerDisconnectedError:
raise ControllerError(f"Connection lost to {self._id} during {method} {action}")