Wait for close of done channel, to ensure manager finished.

This commit is contained in:
Holger Obermaier
2022-01-30 12:08:33 +01:00
parent 8df58c051f
commit 9e99e47d73
4 changed files with 15 additions and 0 deletions

View File

@@ -81,6 +81,7 @@ func (sm *sinkManager) Start() {
s.Close()
}
close(sm.done)
cclog.ComponentDebug("SinkManager", "DONE")
}
@@ -149,6 +150,8 @@ func (sm *sinkManager) AddOutput(rawConfig json.RawMessage) error {
func (sm *sinkManager) Close() {
cclog.ComponentDebug("SinkManager", "CLOSE")
sm.done <- true
// wait for close of channel sm.done
<-sm.done
}
// New creates a new initialized sink manager