fix: endpoints don't create sockets

ref: N25B-217
This commit is contained in:
2025-10-31 10:36:21 +01:00
parent 10deb4bece
commit 20a49eb553
3 changed files with 11 additions and 10 deletions

View File

@@ -17,8 +17,7 @@ async def receive_command(command: SpeechCommand, request: Request):
# Validate and retrieve data.
SpeechCommand.model_validate(command)
topic = b"command"
pub_socket = Context.instance().socket(zmq.PUB)
pub_socket.connect(settings.zmq_settings.internal_pub_address)
pub_socket = request.app.state.endpoints_pub_socket
await pub_socket.send_multipart([topic, command.model_dump_json().encode()])
return {"status": "Command received"}