mirror of
https://github.com/gravitl/netmaker.git
synced 2025-02-27 01:23:00 +08:00
linting fixes
This commit is contained in:
parent
c7dc874bb8
commit
4bc28e455a
1 changed files with 14 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue