diff --git a/modules/mesh-vault/cmd/mesh-vault/main.go b/modules/mesh-vault/cmd/mesh-vault/main.go index 9ae740e1..c74e0449 100644 --- a/modules/mesh-vault/cmd/mesh-vault/main.go +++ b/modules/mesh-vault/cmd/mesh-vault/main.go @@ -71,13 +71,20 @@ func watchHandings(env *Env) bool { if env.Vault == nil { return true } + // The have changes at every look of the bus module's health: why nothing was adopted is said once, and again when + // it changes. + var said string err := stdio.State(HaveRead).Watch("*."+BusModule, func(c stdio.StateChange) error { if c.Op == "delete" || len(c.Value) == 0 { return nil } node := strings.TrimSuffix(c.Key, "."+BusModule) - if _, err := env.Vault.AdoptFrom(node, c.Value, "the watch of "+HaveRead, false); err != nil { + _, err := env.Vault.AdoptFrom(node, c.Value, "the watch of "+HaveRead, false) + if line := fmt.Sprint(err); err != nil && line != said { say("adopted nothing from %s: %v", c.Key, err) + said = line + } else if err == nil { + said = "" } return nil })