Skip to content

Commit

Permalink
Stop and disconnect on stop event
Browse files Browse the repository at this point in the history
  • Loading branch information
ajhai committed Oct 23, 2024
1 parent b76a7d7 commit dd0964f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion llmstack/server/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ async def disconnect(self, close_code):
if self._app_runner:
await self._app_runner.stop()

async def stop(self):
await self.close()

async def _respond_to_event(self, text_data):
json_data = json.loads(text_data)
client_request_id = json_data.get("id", None)
Expand Down Expand Up @@ -227,7 +230,7 @@ async def _respond_to_event(self, text_data):

# TODO: Implement delete asset
elif event == "stop":
self.disconnect()
await self.stop()

async def _respond_to_event_old(self, text_data):
from llmstack.apps.apis import AppViewSet
Expand Down

0 comments on commit dd0964f

Please sign in to comment.