Compare commits

...

1 Commits

Author SHA1 Message Date
Cedric Verstraeten
b0d2409524 stop the motion and livestreaming threads first 2023-02-23 14:58:48 +01:00

View File

@@ -240,6 +240,13 @@ func RunAgent(configuration *models.Configuration, communication *models.Communi
// the agent will cleanup and restart.
status = <-communication.HandleBootstrap
close(communication.HandleONVIF)
communication.HandleONVIF = nil
close(communication.HandleLiveHDHandshake)
communication.HandleLiveHDHandshake = nil
close(communication.HandleMotion)
communication.HandleMotion = nil
// Here we are cleaning up everything!
if configuration.Config.Offline != "true" {
communication.HandleHeartBeat <- "stop"
@@ -263,12 +270,6 @@ func RunAgent(configuration *models.Configuration, communication *models.Communi
subQueue = nil
communication.SubQueue = nil
}
close(communication.HandleONVIF)
communication.HandleONVIF = nil
close(communication.HandleLiveHDHandshake)
communication.HandleLiveHDHandshake = nil
close(communication.HandleMotion)
communication.HandleMotion = nil
// Disconnect MQTT
routers.DisconnectMQTT(mqttClient, &configuration.Config)