Skip to content

Commit

Permalink
Call MQTT StopEngine() on stop command
Browse files Browse the repository at this point in the history
  • Loading branch information
eest committed Jun 3, 2024
1 parent 0631dca commit d583317
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apihandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ func APIcommand(conf *Config) func(w http.ResponseWriter, r *http.Request) {
Status: "stopping",
Msg: "Daemon was happy, but now winding down",
}
log.Printf("Stopping MQTT engine\n")
_, err := conf.TemData.MqttEngine.StopEngine()
if err != nil {
resp.Error = true
resp.ErrorMsg = err.Error()
}
conf.Internal.APIStopCh <- struct{}{}
case "bump":
resp.Msg, err = BumpSerial(conf, cp.Zone)
Expand Down

0 comments on commit d583317

Please sign in to comment.