From a6ae159329938f8252f2495fcc79abafcc1eaf86 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 1 Mar 2019 18:26:52 +0000 Subject: [PATCH] Give some more feedback that a configuration reload actually happens --- src/yggdrasil/core.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/yggdrasil/core.go b/src/yggdrasil/core.go index 2e23dd19..04433282 100644 --- a/src/yggdrasil/core.go +++ b/src/yggdrasil/core.go @@ -125,11 +125,15 @@ func (c *Core) addPeerLoop() { // UpdateConfig updates the configuration in Core and then signals the // various module goroutines to reconfigure themselves if needed func (c *Core) UpdateConfig(config *config.NodeConfig) { + c.log.Infoln("Reloading configuration...") + c.configMutex.Lock() c.configOld = c.config c.config = *config c.configMutex.Unlock() + errors := 0 + components := []chan chan error{ c.admin.reconfigure, c.searches.reconfigure, @@ -148,9 +152,16 @@ func (c *Core) UpdateConfig(config *config.NodeConfig) { response := make(chan error) component <- response if err := <-response; err != nil { - c.log.Println(err) + c.log.Errorln(err) + errors++ } } + + if errors > 0 { + c.log.Warnln(errors, "modules reported errors during configuration reload") + } else { + c.log.Infoln("Configuration reloaded successfully") + } } // GetBuildName gets the current build name. This is usually injected if built