Skip to content

Commit

Permalink
feat(config): add discovery mode
Browse files Browse the repository at this point in the history
  • Loading branch information
adutchak committed Oct 9, 2023
1 parent 2be1bd3 commit 9e94671
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func main() {
continue
}
if len(output.FaceDetails) == 0 {
l.Warn("no faces detected")
l.Errorf("no faces detected in the image: %s", configuration.TargetImagePath)
if !configuration.DiscoveryMode {
publishMqttMessage(mqttClient, configuration.MqttTopic, configuration.MqttNotRecognizedMessage)
continue
Expand Down Expand Up @@ -175,6 +175,8 @@ func main() {
publishMqttMessage(mqttClient, configuration.MqttTopic, configuration.MqttNotRecognizedMessage)
}
}

mqttClient.Disconnect(250)
}
}(doneChan)

Expand Down
3 changes: 3 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,8 @@ func Parse(args []string) (*Config, error) {
conf.ConfidencesNotMoreThanNormalized[s[0]] = s[1]
}
}
if conf.DiscoveryMode {
l.Warn("RUNNING APPLICATION IN DISCOVERY MODE")
}
return conf, nil
}

0 comments on commit 9e94671

Please sign in to comment.