linting fixes

This commit is contained in:
0xdcarns 2022-01-03 18:27:13 -05:00 committed by Matthew R Kasun
parent c7dc874bb8
commit 4bc28e455a

View file

@ -21,6 +21,7 @@ func Daemon() error {
ctx, cancel := context.WithCancel(context.Background())
networks, err := ncutils.GetSystemNetworks()
if err != nil {
cancel()
return err
}
for _, network := range networks {
@ -55,7 +56,7 @@ func Netclient(ctx context.Context, network string) {
cfg.ReadConfig()
//fix NodeID to remove ### so NodeID can be used as message topic
//remove with GRA-73
cfg.Node.ID = strings.ReplaceAll(cfg.Node.ID, "###", "-")
cfg.Node.ID = strings.Replace(cfg.Node.ID, "###", "-", 1)
ncutils.Log("daemon started for network:" + network)
client := SetupMQTT(cfg)
if token := client.Subscribe("#", 0, nil); token.Wait() && token.Error() != nil {
@ -69,8 +70,6 @@ func Netclient(ctx context.Context, network string) {
go Metrics(ctx, cfg, network)
<-ctx.Done()
ncutils.Log("shutting down daemon")
return
ncutils.Log("netclient go routine ended for " + network)
}
// All -- mqtt message hander for all ('#') topics