Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
3fc83eefe6
|
|||
a58959a316
|
|||
2c21ab00a0
|
@ -7,7 +7,7 @@ import "time"
|
||||
//import "net/url"
|
||||
import "ma/mqtt"
|
||||
//import "ma/config"
|
||||
import "ma/counter"
|
||||
//import "ma/counter"
|
||||
import "ma/database"
|
||||
|
||||
var dbh *database.DatabaseHandle
|
||||
@ -31,6 +31,5 @@ func InputArchiver() {
|
||||
func handleMessage(message database.Message) {
|
||||
// log.Printf("Archiving Timestamp: %s, Topic: %s, Payload: %s", message.Time, message.Topic, message.Payload)
|
||||
dbh.StoreMessage(&message)
|
||||
counter.S("Stored")
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,9 @@ func StartMqttClient() {
|
||||
if token := mqttClient.Connect(); token.Wait() && token.Error() != nil {
|
||||
log.Fatalf("Unable to connect to broker %s, error %s", broker, token.Error())
|
||||
}
|
||||
//log.Printf("Successfully connected to broker %s", broker)
|
||||
log.Printf("Successfully connected to broker %s", broker)
|
||||
log.Printf("Include topics: %s", config.Config.IncludeTopics)
|
||||
log.Printf("Exclude topics: %s", config.Config.ExcludeTopics)
|
||||
|
||||
go outputDispatcher(mqttClient)
|
||||
|
||||
|
Reference in New Issue
Block a user