Adds error output to producer start function

This commit is contained in:
Alexey Khit
2022-09-13 14:40:58 +03:00
parent 0fb7132947
commit a11ca1da6e
+5 -1
View File
@@ -79,7 +79,11 @@ func (p *Producer) start() {
log.Debug().Str("url", p.url).Msg("[streams] start producer")
p.state = stateStart
go p.element.Start()
go func() {
if err := p.element.Start(); err != nil {
log.Warn().Err(err).Str("url", p.url).Msg("[streams] start")
}
}()
}
func (p *Producer) stop() {