From a2cebaf90be4693a3b57228f2223dd3890b79e9a Mon Sep 17 00:00:00 2001 From: Cedric Verstraeten Date: Tue, 24 Oct 2023 13:14:14 +0200 Subject: [PATCH] hot fix: wait for token in webrtc --- machinery/src/webrtc/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/machinery/src/webrtc/main.go b/machinery/src/webrtc/main.go index eef62c27..0dc354ec 100644 --- a/machinery/src/webrtc/main.go +++ b/machinery/src/webrtc/main.go @@ -208,7 +208,9 @@ func InitializeWebRTCConnection(configuration *models.Configuration, communicati } payload, err := models.PackageMQTTMessage(configuration, message) if err == nil { - mqttClient.Publish("kerberos/hub/"+hubKey, 0, false, payload) + log.Log.Info("InitializeWebRTCConnection:" + string(candateBinary)) + token := mqttClient.Publish("kerberos/hub/"+hubKey, 0, false, payload) + token.Wait() } else { log.Log.Info("HandleRequestConfig: something went wrong while sending acknowledge config to hub: " + string(payload)) } @@ -233,7 +235,8 @@ func InitializeWebRTCConnection(configuration *models.Configuration, communicati } payload, err := models.PackageMQTTMessage(configuration, message) if err == nil { - mqttClient.Publish("kerberos/hub/"+hubKey, 0, false, payload) + token := mqttClient.Publish("kerberos/hub/"+hubKey, 0, false, payload) + token.Wait() } else { log.Log.Info("HandleRequestConfig: something went wrong while sending acknowledge config to hub: " + string(payload)) }