Skip to content

Commit

Permalink
fix: typo websocket
Browse files Browse the repository at this point in the history
  • Loading branch information
horw committed Dec 10, 2023
1 parent 73306fc commit 96b7821
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/cat/routes/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@

router = APIRouter()

async def receive_message(websoket: WebSocket, stray: StrayCat):
async def receive_message(websocket: WebSocket, stray: StrayCat):
"""
Continuously receive messages from the WebSocket and forward them to the `ccat` object for processing.
"""

while True:
# Receive the next message from the WebSocket.
user_message = await websoket.receive_json()
user_message = await websocket.receive_json()
user_message["user_id"] = stray.user_id

# Run the `ccat` object's method in a threadpool since it might be a CPU-bound operation.
cat_message = await run_in_threadpool(stray, user_message)

# Send the response message back to the user.
await websoket.send_json(cat_message)
await websocket.send_json(cat_message)


async def check_messages(websoket: WebSocket, stray: StrayCat):
Expand Down

0 comments on commit 96b7821

Please sign in to comment.