fix(server): remove misleading "Agent not available" warning.

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan
2025-03-05 14:11:44 -08:00
parent dc4e091622
commit a04167672c
8 changed files with 97 additions and 35 deletions
+9 -1
View File
@@ -24,15 +24,23 @@ func New(ds model.DataStore) *Agents {
}
order = append(order, LocalAgentName)
var res []Interface
var enabled []string
for _, name := range order {
init, ok := Map[name]
if !ok {
log.Error("Agent not available. Check configuration", "name", name)
log.Error("Invalid agent. Check `Agents` configuration", "name", name, "conf", conf.Server.Agents)
continue
}
agent := init(ds)
if agent == nil {
log.Debug("Agent not available. Missing configuration?", "name", name)
continue
}
enabled = append(enabled, name)
res = append(res, init(ds))
}
log.Debug("List of agents enabled", "names", enabled)
return &Agents{ds: ds, agents: res}
}