Mercurial > code > home > repos > rdfdb
changeset 126:1780382477ed
turn a disconnect into a warning
author | drewp@bigasterisk.com |
---|---|
date | Sat, 27 May 2023 17:36:51 -0700 |
parents | 91b0a82df6e0 |
children | a71e4272d808 |
files | rdfdb/service.py |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/rdfdb/service.py Sat May 27 17:34:30 2023 -0700 +++ b/rdfdb/service.py Sat May 27 17:36:51 2023 -0700 @@ -56,7 +56,11 @@ await self.db.addClient(self.connectionId, functools.partial(self._onPatch, websocket)) async def _onPatch(self, websocket: WebSocket, p: Patch): - await websocket.send_text(p.makeJsonRepr()) + try: + await websocket.send_text(p.makeJsonRepr()) + except RuntimeError: + # likely WS disconnect + log.warning("onPatch failed- hope the client calls back") async def on_receive(self, websocket: WebSocket, data: str): if data == 'PING':