Remove release notes from mqtt (#574)

This commit is contained in:
andig 2021-01-04 10:25:15 +01:00 • committed by GitHub
parent a21e9ebb35
commit f118775993
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,9 +21,11 @@ import (
)
var (
ignoreParams = []string{"warn", "error", "fatal"} // don't add to cache
log = util.NewLogger("main")
cfgFile string
log = util.NewLogger("main")
cfgFile string
ignoreErrors = []string{"warn", "error", "fatal"} // don't add to cache
ignoreMqtt = []string{"releaseNotes"} // excessive size may crash certain brokers
)
// rootCmd represents the base command when called without any subcommands
@ -156,7 +158,7 @@ func run(cmd *cobra.Command, args []string) {
// value cache
cache := util.NewCache()
go cache.Run(pipe.NewDropper(ignoreParams...).Pipe(tee.Attach()))
go cache.Run(pipe.NewDropper(ignoreErrors...).Pipe(tee.Attach()))
// setup loadpoints
site, err := loadConfig(conf)
@ -172,7 +174,7 @@ func run(cmd *cobra.Command, args []string) {
// setup mqtt publisher
if conf.Mqtt.Broker != "" {
publisher := server.NewMQTT(conf.Mqtt.Topic)
go publisher.Run(site, tee.Attach())
go publisher.Run(site, pipe.NewDropper(ignoreMqtt...).Pipe(tee.Attach()))
}
// create webserver