Skip to content

Commit

Permalink
fix(server): if cancelling the websocket task fails, websocket might …
Browse files Browse the repository at this point in the history
…not close
  • Loading branch information
maartenbreddels committed Mar 7, 2024
1 parent 8dacf8f commit 9e3cdae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion solara/server/starlette.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ async def run():
await thread_return
finally:
if settings.main.experimental_performance:
ws_wrapper.task.cancel()
try:
ws_wrapper.task.cancel()
except: # noqa
logger.exception("error cancelling websocket task")
try:
await ws.close()
except: # noqa
Expand Down

0 comments on commit 9e3cdae

Please sign in to comment.