Skip to content

Commit

Permalink
Merge pull request #619 from horw/fix/typo_websocket
Browse files Browse the repository at this point in the history
fix: typo websocket
  • Loading branch information
pieroit authored Dec 10, 2023
2 parents 73306fc + 96b7821 commit 8562c5b
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 8562c5b

Please sign in to comment.