deployment
This commit is contained in:
@ -10,9 +10,12 @@ import "ma/mqtt"
|
||||
import "ma/counter"
|
||||
import "ma/database"
|
||||
|
||||
var dbh *database.DatabaseHandle
|
||||
|
||||
|
||||
func InitArchiver() {
|
||||
log.Printf("Archiver initializing")
|
||||
dbh = database.NewDatabaseHandle()
|
||||
}
|
||||
|
||||
func InputArchiver() {
|
||||
@ -27,6 +30,7 @@ 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")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user