Skip to content

Commit

Permalink
fix: resolving fatal when disabling of mqtt
Browse files Browse the repository at this point in the history
fix #281
  • Loading branch information
tobiasehlert committed Jun 19, 2024
1 parent f7ac2f7 commit b306335
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ func main() {

// Connect to the MQTT broker
statusCache, err := startMQTT()
if err != nil {
if !getEnvAsBool("DISABLE_MQTT", false) && err != nil {
log.Fatalf("[error] TeslaMateApi MQTT connection failed: %s", err)
} else if getEnvAsBool("DISABLE_MQTT", false) {
log.Println("[info] TeslaMateApi MQTT connection not established.")
}

if getEnvAsBool("API_TOKEN_DISABLE", false) {
Expand Down

0 comments on commit b306335

Please sign in to comment.