Make mqtt websocket subscribe use callback functions (#87885)

Nothing was being awaited so this was needlessly generating tasks when the callbacks fired
pull/87939/head
J. Nick Koston 2023-02-12 14:05:37 -06:00 committed by GitHub
parent 1d4d688af3
commit 753c7abaf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -596,7 +596,8 @@ async def websocket_subscribe(
if not connection.user.is_admin:
raise Unauthorized
async def forward_messages(mqttmsg: ReceiveMessage) -> None:
@callback
def forward_messages(mqttmsg: ReceiveMessage) -> None:
"""Forward events to websocket."""
try:
payload = cast(bytes, mqttmsg.payload).decode(