Check that at least one sink is running

This commit is contained in:
Holger Obermaier 2022-06-23 15:44:02 +02:00
parent 8e7143a20a
commit a3ac8f2ead

View File

@ -76,11 +76,17 @@ func (sm *sinkManager) Init(wg *sync.WaitGroup, sinkConfigFile string) error {
for name, raw := range rawConfigs { for name, raw := range rawConfigs {
err = sm.AddOutput(name, raw) err = sm.AddOutput(name, raw)
if err != nil { if err != nil {
cclog.ComponentError("SinkManager", err.Error()) cclog.ComponentError("SinkManager", err)
continue continue
} }
} }
// Check that at least one sink is running
if !(len(sm.sinks) > 0) {
cclog.ComponentError("SinkManager", "Found no usable sinks")
return fmt.Errorf("Found no usable sinks")
}
return nil return nil
} }